You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 wrong
i load it as usual
as new Dotenv() entry in the plugin section:
The text was updated successfully, but these errors were encountered:
wibed
changed the title
get MISSING_ENV_VAR on esm modules
dotenv-webpack not working. env file not loaded. any var is undefined
Aug 21, 2023
wibed
changed the title
dotenv-webpack not working. env file not loaded. any var is undefined
dotenv-webpack not working. env file not loaded. variables are undefined
Aug 21, 2023
package.json: "build:local": "webpack --mode development --env NODE_ENV=local",
webpack config:
module.exports = async (env, options) => {
...
new DotenvWebpackPlugin({
systemvars: true,
path: `./env/.env.${env.NODE_ENV}` // This means the env files are in a folder called `env` at the root
}),
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.
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: