Cannot set property 'index' of undefined in webpack. I am following a video lecture and got this error of which I got no help on google.
In Webpac/dist/index.js
chunks.forEach((chunk, i) => {
const extractedChunk = extractedChunks[i];
extractedChunk.index = i;
extractedChunk.originalChunk = chunk;
extractedChunk.name = chunk.name;
In custom file webpack.config.js
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
module.exports = {
entry: "./config.js",
output: {
filename: "app.js",
path: path.resolve(__dirname, "public/javascripts"),
},
};
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{
loader: "css-loader",
options: {
minimize: true,
},
},
],
}),
},
],
},
plugins: [new ExtractTextPlugin("../stylesheets/app.css")],
};
[1]: https://i.stack.imgur.com/LV9m1.png
[2]: https://i.stack.imgur.com/aiMj0.png
[3]: https://i.stack.imgur.com/vjRih.png