Webpack5: mod is not defined
See original GitHub issueBug report
What is the current behavior?
Building a project in production mode using webpack5 results in a mod is not defined error at runtime.
If you build with development mode, no errors will occur at runtime. In webpack4 this error does not occur when building in production mode.
Also, when building with webpack4, there are no deprecation warnings.
So I think this is a bug in webpack5.

If the current behavior is a bug, please provide the steps to reproduce.
I haven’t created a minimal reproducible repository yet, but here is the actual my project config.
https://github.com/syuilo/misskey/blob/develop/webpack.config.ts
What is the expected behavior?
No runtime error
Other relevant information: webpack version: 5.0.0-beta.13 Node.js version: 13.7.0 Operating System: Windows10 Additional tools:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (6 by maintainers)

Top Related StackOverflow Question
I’ve got this error as well on both modes
ReferenceError: mod is not definedwhich isin production mode:
This is caused by inline <style> in .vue file for me. It seems to me like issue with tree shaking and side effects?
Other relevant information: webpack version: 5.0.0-beta.13 Node.js version: 13.10.1 Operating System: Windows10 Additional tools:
I think so