#.env variable cannot access

24 messages · Page 1 of 1 (latest)

feral urchin
#

I cannot access any variable in the .env file

green cave
#

Show .env then

ancient steppe
#

your env file is not in the backend folder where you're running it from

supple grail
#

it wasn't on the first run, but it appears to be now (both from the file structure on the left and seeing that they didn't get a file load error the second time around)

#

i agree that seeing the file will be important 🙂

rustic lantern
#

I think the problem is the location of his binary if he's using build and if he's run need to change the path to the .env file

#

../../internal/.env try this I think

supple grail
#

no, it is not under the internal directory

#

it is under the backend directory

#

the spacing can make it a little hard to tell, but vs code only collapses to internal/server if server is the only thing within internal

#

(and the location of the binary is irrelevant to the working directory, which is where the file is loaded relative to)

cerulean ridge
#

why are so many people using .env /godotenv ? is that all copy pasted from some tutorial somewhere?

cerulean ridge
#

I mean using dotenv ... env vars should be set outside not inside a process

rustic lantern
#

At least that's what I know

supple grail
#

yes, correct

#

that is not the binary location

#

see the directory in the screenshot

#

the file is being loaded correctly, that is not the issue

rapid shale
cerulean ridge
#

yeah I suppose though sometimes because something is convenient isn't sufficient justification

rustic lantern