TypeError: ManifestPlugin is not a constructor
See original GitHub issue- Manifest Plugin Version: 3.0.0
- Webpack Version: 5.9.0
- Operating System (or Browser): MacOS Catalina
- Node Version: v12.13.0
- Link to reproduction (β οΈ read below): https://repl.it/@mizziness/manifest-plugin-repro#package.json
(Note: the above repro is an exact copypasta of my local project, however, I get a the same thing with a minimal build, so I am able to rule out my other plugins and config. A link to that super minimal repo is: https://repl.it/@mizziness/manifest-plugin-repro-1#package.json )
Expected Behavior
I expect to be able to run basic webpack commands without error.
Actual Behavior
Webpack commands, such as webpack --mode development result in the error: [webpack-cli] TypeError: ManifestPlugin is not a constructor
Additional Information
Local stack trace using yarn:
yarn run v1.22.5
$ webpack --mode development
[webpack-cli] TypeError: ManifestPlugin is not a constructor
at Object.<anonymous> (/Applications/MAMP/help.applause.com/webpack.config.js:79:5)
at Module._compile (/Applications/MAMP/help.applause.com/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (/Applications/MAMP/help.applause.com/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at requireConfig (/Applications/MAMP/help.applause.com/node_modules/webpack-cli/lib/groups/resolveConfig.js:73:18)
at Array.map (<anonymous>)
at resolveConfigFiles (/Applications/MAMP/help.applause.com/node_modules/webpack-cli/lib/groups/resolveConfig.js:124:40)
error Command failed with exit code 2.
Workaround:
Currently, using webpack-manifest-plugin@^2.0.3 will allow me to build correctly.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
ManifestPlugin is not a constructor Β· Issue #230 - GitHub
I had this issue just now, and it turned out to be because npm i webpack-manifest-plugin had inexplicably installed version 2.2.0 (why?), which...
Read more >TypeError: webpackManifestPlugin is not a constructor
My build script is failing after upgrading webpack with the following error: TypeError: webpackManifestPlugin is not a constructor.
Read more >Error in node.js webpack-cli failed to load config, typeError
The error you get is: [webpack-cli] TypeError: ManifestPlugin is not a constructor. You are trying to load weback-manifest-plugin it likeΒ ...
Read more >TypeError: CleanwebpackPlugin is not a constructor-Vue.js
[Solved]-TypeError: CleanwebpackPlugin is not a constructor-Vue.js ... It is class name of this plugin which is being imported, so there is no place...
Read more >webpack-manifest-plugin - npm
A Webpack Plugin for generating Asset Manifests. Latest version: 5.0.0, last published: 10 months ago. Start using webpack-manifest-plugin ...
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
There is no longer a default export, try changing the require to
(and switch ManifestPlugin with WebpackManifestPlugin in the webpack config)
Itβs in the README. Always read the docs when upgrading majors.