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
I was trying to upgrade my stack from webpack 4 to webpack 5. And got the following error from dotenv-webpack:
[webpack-cli] TypeError: Cannot read property 'startsWith' of undefined
at Dotenv.shouldStub (F:\_projects_\...\node_modules\dotenv-webpack\dist\index.js:210:20)
at Dotenv.formatData (F:\_projects_\...\node_modules\dotenv-webpack\dist\index.js:192:16)
at Dotenv.apply (F:\_projects_\...\node_modules\dotenv-webpack\dist\index.js:66:23)
at WrappedPlugin.apply (F:\_projects_\...\node_modules\speed-measure-webpack-plugin\WrappedPlugin\index.js:292:29)
at createCompiler (F:\_projects_\...\node_modules\webpack\lib\webpack.js:71:12)
at create (F:\_projects_\...\node_modules\webpack\lib\webpack.js:118:16)
at webpack (F:\_projects_\...\node_modules\webpack\lib\webpack.js:126:47)
at WebpackCLI.f [as webpack] (F:\_projects_\...\node_modules\webpack\lib\index.js:41:15)
at WebpackCLI.createCompiler (F:\_projects_\...\node_modules\webpack-cli\lib\webpack-cli.js:1678:29)
at async WebpackCLI.buildCommand (F:\_projects_\...\node_modules\webpack-cli\lib\webpack-cli.js:1785:20)
at async Command.<anonymous> (F:\_projects_\...\node_modules\webpack-cli\lib\webpack-cli.js:564:25)
at async Promise.all (index 1)
at async Command.<anonymous> (F:\_projects_\...\node_modules\webpack-cli\lib\webpack-cli.js:1120:13)
error Command failed with exit code 2.
Further debugging, I've found that compiler.webpack.version is undefined.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
I was trying to upgrade my stack from webpack 4 to webpack 5. And got the following error from
dotenv-webpack
:Further debugging, I've found that
compiler.webpack.version
is undefined.I've used patch-package to patch
[email protected]
to make it work. Here is the diff that solved my problem:This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: