-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nx vs Next.js | Environments files loaded in wrong order #7266
Comments
hi @ild0tt0re , thanks for opening the issue! so as you noted, Nx doesn't currently support environment variable files other than those that are mentioned in the docs that you linked to (Docs). I assume this issue occurs only when you're using env files that Nx doesn't support, like |
Hi @kirjai , thanks for the answer. Exactly! |
Can Nx provide a configuration item to turn off its own dotenv processing, which is completely handled by plugins? |
+1 for consideration on this. It would be great if it matches the Next.js behaviour. |
Same issue with loading order holds true for nest.js + nx combination. The load order of nx overrides the one of the nest.js config module definition which makes the integration not as smooth as everything else nx does so far. A configuration option to disable default loader would be welcome. |
And as a follow-up => https://github.com/nrwl/nx/releases/tag/14.8.6 |
Closing due to no activity and should be working currently. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
nx serve
command, load.env
file inapps/<next-app>
two times:That cause
.env
file to be loaded inprocess.env
on the first loading (Nx) so during the second loading (Next.js) the order is no longer maintained -> https://github.com/vercel/next.js/blob/canary/packages/next-env/index.ts#L52i.e: same env var in both
.env.development
and.env
, cause.env
to have highest priorityExpected Behavior
The order of Next.js environment variables should be maintained
i.e: same env var in both
.env.development
and.env
, should give to.env.development
highest prioritySteps to Reproduce
nx serve
.env
and not.env.development
)Environment
The text was updated successfully, but these errors were encountered: