nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.58k stars 2.36k forks source link

root .env is not loading. #18391

Closed nicezic closed 1 year ago

nicezic commented 1 year ago

Current Behavior

https://nx.dev/recipes/tips-n-tricks/define-environment-variables

./.env file is not loading. only ./apps/my-app/.env is loading.

Expected Behavior

https://nx.dev/recipes/tips-n-tricks/define-environment-variables

the root ./.env file should be loaded.

GitHub Repo

No response

Steps to Reproduce

  1. create nestjs apps.
  2. make ./.env file at root and set variable.
  3. load it from the app.

Nx Report

$ nx report
>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node   : 18.16.1
   OS     : linux-x64
   npm    : 9.5.1

   nx (global)        : 16.5.5
   nx                 : 16.5.5
   @nx/js             : 16.5.5
   @nx/jest           : 16.5.5
   @nx/linter         : 16.5.5
   @nx/workspace      : 16.5.5
   @nx/devkit         : 16.5.5
   @nx/eslint-plugin  : 16.5.5
   @nx/nest           : 16.5.5
   @nx/node           : 16.5.5
   @nrwl/tao          : 16.5.5
   @nx/webpack        : 16.5.5
   nx-cloud           : 16.1.1
   typescript         : 5.1.6
   ---------------------------------------
   Local workspace plugins:
         @yhpark-nx/auth

Failure Logs

No response

Operating System

Additional Information

  1. it was working preview nx version.
nicezic commented 1 year ago

I don't know why. but... it read now... cache problem? Anyone know why?

AgentEnder commented 1 year ago

I'm not sure why you would have hit this, but if its not happening now and we can't repro it I'm going to go ahead and close this issue. If it comes back up feel free to open a new report.

github-actions[bot] commented 1 year ago

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.