[5.0.0] TypeError: webpack.HashedModuleIdsPlugin is not a constructor
See original GitHub issueBug report
What is the current behavior? I get this error when building the project after upgrading to 5.0.0:
[webpack-cli] TypeError: webpack.HashedModuleIdsPlugin is not a constructor
If the current behavior is a bug, please provide the steps to reproduce.
const webpack = require('webpack')
// ...
plugins: [
// ...
new webpack.HashedModuleIdsPlugin(),
// ...
],
// ...
What is the expected behavior? At least migration information should be shown on screen or in the docs.
Other relevant information: webpack version: 5.0.0 Node.js version: 14.12.0 Operating System: Windows 10 64 bit Additional tools: npm
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HashedModuleIdsPlugin - webpack
HashedModuleIdsPlugin. This plugin will cause hashes to be based on the relative path of the module, generating a four character string as the...
Read more >webpack is not a constructor | The AI Search Engine You Control
It is not working because it is missing libraryTarget and library properties. Favicon for github.com. [5.0.0] TypeError: ...
Read more >TypeError: webpack.CopyWebpackPlugin is not a constructor
Please try it with: const CopyWebpackPlugin = require('copy-webpack-plugin');. I think there is no named export named "CopyWebpackPlugin".
Read more >webpack4项目升级webpack5实践 - 夜听城嚣
h5\build\webpack.prod.conf.js:136 new webpack.HashedModuleIdsPlugin(), ^ TypeError: webpack.HashedModuleIdsPlugin is not a constructor.
Read more >azu on Twitter: "ids.HashedModuleIdsPluginに移動してるんだ ...
リリースノートには入ってない気もする "[5.0.0] TypeError: webpack. ... HashedModuleIdsPlugin is not a constructor · Issue #11631 · webpack/we ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dvopalecky I’ve filed a pull request to fix it.
https://webpack.js.org/migrate/5/#update-outdated-options
Further, the recommend solution with webpack 5 is using “deterministic”, which is the default in production mode. https://webpack.js.org/migrate/5/#clean-up-configuration