skip to Main Content
[I am getting invalid url error in an appwrite and react + vite website

I have tried console.log(conf.appwriteUrl) to check if url and ProjectID is passing on correctly(they are) and there are no typo in the url and project id
] here is an image of my code :

enter image description here

Error says "Failed to construct ‘URL’: Invalid URL"
and here is an image of an error:
enter image description here

2

Answers


  1. What URL are you using? It is the best to copy paste the server endpoint from the project settings page.

    Login or Signup to reply.
  2. The Appwrite SDK accepts a string type as the parameter in the client.setEndpoint function, not the URL type. An example of this is:

    client
        .setEndpoint('https://cloud.appwrite.io/v1')
        .setProject('[PROJECT-ID]');
    

    Can you check if your type is set correctly in the conf.js file? This might be causing an error cirumstantially.

    Additionally, it would help to recheck if the right endpoint has been copied from the Appwrite Console as well.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search