Replies: 12 comments 2 replies
-
Do you use the latest version? Because this error should be fixed |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I wonder if it's the same issue reported here #647 |
Beta Was this translation helpful? Give feedback.
-
Yeah I haven't yet got to releasing a new version with #649 changes in. I was meaning to analyze the regression I saw in CI when I fixed it to again work before I'd release a new major version. I commented on #650 for those mysterious cases that had now been failing but I hadn't yet figured out which changes could've caused the tests to start failing. So it could be that once a new version with #649 are in, this would be fixed. Can you test that out by following the "Develop with your own project" steps in CONTRIBUTING.md to see if your problem would be fixed with the changes we have in |
Beta Was this translation helpful? Give feedback.
-
Tried, not fixed |
Beta Was this translation helpful? Give feedback.
-
@fregante Can you create reproducible test repo? Because it means your code is not parsable by acorn, that is very weird |
Beta Was this translation helpful? Give feedback.
-
Yes, it happens, that's the issue. The real issue (syntax error) is lost in webpack-bundle-analyzer's output. What I do to repro it is just break a file by adding |
Beta Was this translation helpful? Give feedback.
-
@fregante I fully understand why and when parsers are failed (and reasons), the question - why you have broken JS code in your output? And I ask about the reproducible test repo to understand - why you have broken code. |
Beta Was this translation helpful? Give feedback.
-
I think the point is that webpack will not generate the builds, so there's no output. The build fails completely because of the syntax error in my source files. But webpack-bundle-analyzer still knows about the files that are supposed to be generated. As the error says: Error parsing bundle asset ——: no such file |
Beta Was this translation helpful? Give feedback.
-
@fregante Got it, so we need to skip files which contains errors or was not generated |
Beta Was this translation helpful? Give feedback.
-
Correct. ReproIt's as basic as can be: npm init -y
npm install webpack webpack-cli webpack-bundle-analyzer --save-dev
echo '/' > index.js then copy-paste this into webpack.config.js const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
plugins: [
new BundleAnalyzerPlugin({analyzerMode: 'static', openAnalyzer:false})
]
} and run npx webpack ./index.js --mode production Output
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll convert this to a feature request discussion to have them be in the same place ☺ |
Beta Was this translation helpful? Give feedback.
-
When the build fails, webpack-bundle-analyzer fills up the logs with irrelevant lines:
This time 100 because my build is generating several small bundles (icons)
The plugin should detect failure and avoid trying to read bundles that don't exist
Beta Was this translation helpful? Give feedback.
All reactions