[ad_1]
In my project flux-react-router-example, my webpack.config.js file is as follows:
var path = require('path'); var webpack = require('webpack'); module.exports = { entry: [ 'webpack-hot-middleware/client', './scripts/index' ], devtool: 'eval-source-map', output: { path: __dirname, filename: 'bundle.js', publicPath: '/static/' }, plugins: [ new webpack.HotModuleReplacementPlugin(), ], optimization: [ new webpack.optimization.emitOnErrors() ], module: { loaders: [{ test: /\.js$/, loaders: ['babel'], include: path.join(__dirname, 'scripts') }] } };
And my terminal in visual studio code is saying this:
C:\Users\p-c\Downloads\Github\flux-react-router-example\webpack.config.js:20 new webpack.optimization.emitOnErrors() ^ TypeError: Cannot read properties of undefined (reading 'emitOnErrors') at Object. (C:\Users\p-c\Downloads\Github\flux-react-router-example\webpack.config.js:20:30) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (C:\Users\p-c\Downloads\Github\flux-react-router-example\server.js:4:14) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
My webpack version is [email protected].0
My node version is v16.15.0
My npm version is 8.3.1
[ad_2]