Replies: 12 comments 2 replies
|
Do you use the latest version? Because this error should be fixed |
|
|
I wonder if it's the same issue reported here #647 |
|
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 |
|
Tried, not fixed |
|
@fregante Can you create reproducible test repo? Because it means your code is not parsable by acorn, that is very weird |
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 |
|
@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. |
|
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 |
|
@fregante Got it, so we need to skip files which contains errors or was not generated |
|
Correct. ReproIt's as basic as can be: npm init -y
npm install webpack webpack-cli webpack-bundle-analyzer --save-dev
echo '/' > index.jsthen 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 productionOutput |
|
Thanks! I'll convert this to a feature request discussion to have them be in the same place ☺ |
Uh oh!
There was an error while loading. Please reload this page.
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
All reactions