#.env file problem

1 messages · Page 1 of 1 (latest)

reef cobalt
#

I'm having problem loading the env variables into my files. I have a file .env with
API_ENDPOINT=http://localhost:8000/api in it.

When I try to import it using import.meta.env.API_ENDPOINT, it returns undefined.

odd cloak
reef cobalt
#

Ahh okay, ty

frail leaf
#

I'm having the same problem even when adding the prefix
@odd cloak

odd cloak
frail leaf
#

@odd cloak
Sorry for late reply I was exploring different approaches
I created a new project from scratch and it just worked

#

Thank you

odd cloak
#

Thanks for the update!

tidal lagoon
frail leaf
tidal lagoon
#

okay I'll try

#

although I've pushed it to Git

#

can i ask some additional question about .env?

tidal lagoon
#

it worked

frail leaf
frail leaf