Back

[SOLVED] TypeError: Failed to construct 'URL': Invalid URL

  • 0
  • Web
Hippiee
12 Dec, 2023, 17:05

yes

TL;DR
The user encountered a TypeError: Failed to construct 'URL': Invalid URL issue. They received help and were able to fix the problem. The issue was caused by extra quotes in the .env file. The solution was to remove the extra quotes when setting the value.
Hippiee
12 Dec, 2023, 17:09

is it a url problem ? like is https://cloud.appwrite.io/v1 not working ?

Hippiee
12 Dec, 2023, 17:09

it shouldnt be afaik

Drake
12 Dec, 2023, 17:11

ya...it should work...The only thing i can think of is if you're using some framework where the env var doesn't work in some context

Hippiee
12 Dec, 2023, 17:13

but it is being printed right in console.log

Drake
12 Dec, 2023, 17:13

wait no...there are extra quotes

Hippiee
12 Dec, 2023, 17:14

what?

Drake
12 Dec, 2023, 17:15

in your .env file, you added single quotes around the value?

Hippiee
12 Dec, 2023, 17:16

yes

Hippiee
12 Dec, 2023, 17:16

its single

Drake
12 Dec, 2023, 17:16

get rid of them

Hippiee
12 Dec, 2023, 17:22

thats seems to decrease the erros

Hippiee
12 Dec, 2023, 17:22

errors*

Hippiee
12 Dec, 2023, 17:22

wait a min

Hippiee
12 Dec, 2023, 17:25
Drake
12 Dec, 2023, 17:42

get rid of the semicolon too

Hippiee
12 Dec, 2023, 17:48

y6eah i did

Drake
12 Dec, 2023, 17:48

so any other errors now?

Hippiee
12 Dec, 2023, 17:49
Drake
12 Dec, 2023, 17:49

there's probably something wrong with your project id

Hippiee
12 Dec, 2023, 17:56

ok ill find it

Hippiee
12 Dec, 2023, 18:12

fixed

Hippiee
12 Dec, 2023, 18:12

ty

Hippiee
12 Dec, 2023, 18:15

beginner mistakes πŸ’€ ty tho

Drake
12 Dec, 2023, 18:17

[SOLVED] TypeError: Failed to construct 'URL': Invalid URL

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more