Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'chunkFilename' of undefined #38

Closed
mnpenner opened this issue Mar 16, 2018 · 1 comment
Closed

Cannot read property 'chunkFilename' of undefined #38

mnpenner opened this issue Mar 16, 2018 · 1 comment

Comments

@mnpenner
Copy link

I'm getting this error when attempting to compile my project for webpack 4 with mini-css-extract-plugin

ERROR in chunk main [entry]
main.e2e70e8fb55738755967.css
Cannot read property 'chunkFilename' of undefined

I don't see any other error details, so I'm not sure where I would even begin to look for the problem.

I've set up mini-css like this:

        plugins: [
            new MiniCssExtractPlugin({
                filename: '[name].[hash].css',
                chunkFilename: 'chunk.[chunkhash].css',
            }),
        ],
        module: {
            rules: [
                {
                    test: /\.less$/,
                    use: [MiniCssExtractPlugin.loader, ...cssLoaders, lessLoader],
                },
                {
                    test: /\.css$/,
                    use: [MiniCssExtractPlugin.loader, ...cssLoaders],
                },
            ],
        },

The loaders look like this if you want to see those too:

let cssLoaders = [
    {
        loader: 'css-loader',
        options: {
            sourceMap: cssSourceMaps,
            root: publicDir,
            localIdentName: '[name]_[local]--[hash:base64:5]',
            importLoaders: 2,
        }
    },
    {
        loader: 'postcss-loader',
        options: {
            sourceMap: cssSourceMaps ? 'inline' : false,
        }
    }
];

let lessLoader = {
    loader: 'less-loader',
    options: {
        sourceMap: cssSourceMaps, // https://github.com/webpack-contrib/less-loader#sourcemaps
        strictMath: true,
        strictUnits: true,
    }
};

I've tried setting the filenames the same as the README too:

      filename: "[name].css",
      chunkFilename: "[id].css"

But I get the same error.

I've got dozens of .less files, so I'm not sure which one, if any, is tripping up the plugin.

@mnpenner
Copy link
Author

Going to close this for now. I think it might be chunk-manifest-webpack-plugin actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant