-
-
Notifications
You must be signed in to change notification settings - Fork 384
Cannot read property 'pop' of undefined #505
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
Comments
#487 Got the same problem, any idea to the cause? |
more likely this #341 |
This happens because your entry point shares its name with the cache group entry: {
index: './src/index.jsx',
},
...
cacheGroups: {
indexStyles: {
name: 'index',
test: (m, c, entry = 'index') => {
return m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry;
},
chunks: 'all',
enforce: true,
}
} Try changing your cacheGroups: {
index: {
name: 'indexStyles',
test: (m, c, entry = 'index') => {
return m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry;
},
chunks: 'all',
enforce: true,
}
} |
Answer above, it will be an error in webpack@5 by default, we can't fix it on our side, sorry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Operating System: macOS Catalina 10.15.2
Node Version: 10.16.0
NPM Version: 6.9.0
webpack Version: 4.17.2
mini-css-extract-plugin Version: 0.9.0
Expected Behavior
A spa demo with two pages https://github.com/purple-force/mini-css-issue.
page1.jsx
andpage2.jsx
is loaded byreact-loadable
inindex.jsx
, wherereact-loadable
's loading is set to() => <Loading />
.loading.jsx
importloading.css
. It will not throw above error ifimport './loading.css'
is removed.The error is from https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js#L498, where
bestMatch
isundefined
.what expected is
js
,css
files in build directory after run build with name set byoutput.filename
andnew MiniCssExtractPlugin
's optionfilename
. andcss
contents are in one file.But if chunkFilename is set,filename will be invalid.Actual Behavior
Cannot read property 'pop' of undefined
The text was updated successfully, but these errors were encountered: