chunk.mapModules is not a function
See original GitHub issueBefore you open an issue, please check if a similar issue already exists or has been closed before.
When reporting a bug, please be sure to include the following:
- A descriptive title
- An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
- What version of
purgecss
you’re using, and the platform(s) you’re running it on “purgecss-webpack-plugin”: “^0.19.0” Windows 7 - The behavior you expect to see, and the actual behavior
not crashing when
npm run build
new PurgecssPlugin({
paths: [path.resolve(__dirname, './dist/index.html'), ...glob.sync(path.resolve(__dirname, './src/*'))],
})
dist/
is the bundle output folder
src/
is where the React components go.
output:
...
C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:148
return chunk.mapModules(function (module) {
^
TypeError: chunk.mapModules is not a function
at files (C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:148:18)
at C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:199:90
at Array.forEach (<anonymous>)
at C:\dev\projects\webui\node_modules\purgecss-webpack-plugin\lib\purgecss-webpack-plugin.js:195:39
at Array.forEach (<anonymous>)
Can you spot what could be causing this error? Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
TypeError: chunks.map is not a function · Issue #19 - GitHub
Just tried to create an example for styled-jss and got this error: prejss git:(prejss) npm run build (node:96238) fs: re-evaluating native ...
Read more >chunks.some is not a function - webpack - Stack Overflow
I managed to fix it by using the following: splitChunks: { cacheGroups: { vendor: { name: 'vendor', chunks: 'all', reuseExistingChunk: true, ...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >How to Solve the Chunk Load Error in JavaScript - Rollbar
Whenever there's an error observed in dynamically fetching helper JavaScript files known as Chunks, a ChunkLoad Error is thrown.
Read more >TypeError Handling in React.js for Map Function | Pluralsight
This error occurs because your data is not an array. The .map() function only works with arrays. First, you'll need to confirm your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CanbingChen this should fix your issue: In your config of purgecss add the option
{ nodir: true }
intoglob
, like this:paths: glob.sync('${PATHS.src}/*', { nodir: true })
@Ffloriel I’ve got the error after update webpack.the terminal show “illegal operation on a directory, read”