-
Notifications
You must be signed in to change notification settings - Fork 76
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
dotenv-webpack not working. env file not loaded. variables are undefined #496
Comments
Running into this as well; it seems like it's not loading the |
Have you tried this? package.json: webpack config:
|
for me this is not working right. i had some success installing accessible but remained empty. the path was set up as explained above. |
The problem might be legitimate. I don’t have a lot of experience with module npm support. Anyone else here able to check out my code to see what’s going on? also, if anyone has a simplified boilerplate here I could download that and give it a try. |
We are using a Lerna Monorepo to manage multiple applications within a single repository. At the root level, we have a .env file where we define variables like:
However, when we start the application using the command below, it throws the error "process is undefined". We are accessing
The command used to start the application is:
In our webpack configuration, we use the following to load the environment variables:
Should I run export IS_MSW_ENABLED=true in the terminal to resolve this issue?
@mrsteele Let me know for more info |
@nthombare-mdsol could you make a simplified repo so I can see the rest of your setup? I've been waiting for more info here and having a hard time solving without more context. |
using esm module based project
dotenv-webpack
does not prevent the app from starting, any env variable ends up beeing undefined.other plugins work as expected, thats why i dont assume my
webpack.config.ts
to be wrongi load it as usual
as
new Dotenv()
entry in the plugin section:The text was updated successfully, but these errors were encountered: