2018-package-three-webpack-plugin
2018-package-three-webpack-plugin copied to clipboard
Cannot read property 'normalModuleFactory' of undefined
When setting up the webpack plugin for a react app, I am receiving the following error when running npm start.
Cannot read property 'normalModuleFactory' of undefined
I have included the two lines in my webpack.config.dev.js file:
const ThreeWebpackPlugin = require('@wildpeaks/three-webpack-plugin'); ( at the top)
module.exports = {
// .......... ,
plugins: [
///other plug ins,
new ThreeWebpackPlugin()
],
},
Does ThreeWebpackPlugin take an argument? Any help would be much appreciated!
Same issue for me
@soccer1mt are you using create-react-app? Did you put the plugin in the ejected webpack config?
If so, what version of react-scripts
are you using? (check it from the package.json)
It does not work with webpack@^3.10.0.
It is because the developer are using webpack 4, however most the products are developed by webpack3.
@yiakwy use a previous version of this plugin if you use webpack 3.
Webpack4 has been the major version for quite some time now (10 months), it is normal that this plugin supports only webpack4.
https://github.com/wildpeaks/package-three-webpack-plugin/releases
@marcofugaro webpack 4 released on Feb 25, 2018, and I keep my eye on it. I will switch to it if I start a new and light project. That will be a disaster to change underline tools if you have intensive dependencies from old projects. We have been using webpack 3 since Jun 19, 2017.
And your solution is neat but might not work. Actually, I have resolved the problem by manually adding searching path to the unofficial libraries. If you installed three using npm, it won't include editor and examples modules. This is the key problem why we appeal three to release them.