[V5] ENV_PATH not working #3481
Replies: 2 comments 1 reply
-
Are you sure that port 3333 is not already in use on your machine? Replace port 3333 by 3337 for example in your .env.local file and see if this port get assigned. If it is, it means that port 3333 is already used by a process on your machine |
Beta Was this translation helpful? Give feedback.
-
I noticed the same behavior here, so I went and searched the code. In fact, the dev server will look for the three variables HOST, PORT, and TZ in the .env file, no matter the value of ENV_PATH : So a quick way to fix this is to run the application like this: @thetutlage Maybe we could use Or another solution could be to make the .env parsed by the application overwrite the rest? |
Beta Was this translation helpful? Give feedback.
-
Hi folks, i don't know whats happens but simply ENV_PATH stop working, im my project i have
.env
and.env.local
files, and i use.env.local
by the comandENV_PATH=.env.local node ace serve --watch
and its was working normaly, so i installedcross-env
as developement dependency and my script on package.json was something like that:this works until today... but now a strange thing is happening, i will show
My env files:
My Package.json:
.env file content:
.env.local file content:
Basically the only difference is the port, node environment and database variables, but on
.env
the port is3334
and.env.local
the port is3333
, when i run the comandENV_PATH=.env.local node ace serve --watch
, is expected that the application use.env.local
and run on port3333
, but its not happens, look at the result:Adonis get data from
.env
instead.env.local
file, when i delete.env
file, so the adonis get from.env.local
, but if i delete.env.local
instead.env
i got error, that is the adonis load.env.local
but get data from.env
PS: I just follow this documentation link https://docs.adonisjs.com/guides/environment-variables#do-not-commit-the-env-file
OS: Windows 10
AodnisJS: 5.3.4
Node: 14.18.1
Beta Was this translation helpful? Give feedback.
All reactions