Repository navigation
Errors when using with the webpack dev server 4 #471
Description
Activity
Please provide reproducible test repo
Here is the minimal project to repro this issue:
https://github.com/zdm/webpack-bundle-analyzer-issue-471npm i npx webpack-dev-serverSee errors:
... Error parsing bundle asset "d:\downloads\webpack-bundle-analyzer-issue-471\www\js\vendors.1989a8af.js": no such file Error parsing bundle asset "d:\downloads\webpack-bundle-analyzer-issue-471\www\js\app.f747955a.js": no such file ...You are on windows, but uses
https://github.com/zdm/webpack-bundle-analyzer-issue-471/blob/main/webpack.config.js#L17(i.e./), please usepath.resolve(__dirname, '/www')- I updated code to use path.resolve. Results are the same.…On 02.10.2021 19:06, Alexander Akait wrote: |path.resolve(__dirname, '/www')|
Under linux results are the same too.
The problem is not in the paths separators.Yep, I see, investigating
@valscion Found a bug, we should use
compiler.outputFilesystem, notfsto be compatibility with dev server and not only (because other plugins can override fs)Reacted by opto-dev@valscion Yes 👍
Is it fixable?
It's likely that it's fixable. It would require adding more test coverage to make sure the fix would not regress in the future and we don't have much tests for
webpack-dev-serverintegration yet so it's not a straightforward task.That's why I haven't had time to fix this yet. Feel free to try to fix it and provide a PR if it would be important to you for this bug to be fixed
☺️ This can be problematic for me because I am not in the context of this project.
I can help in testing.
Will wait, no other way...Is it possible to fix this?
Same problem withwebpack 5.@zdm Yes, do you want to send a PR? I can point where to fix it
I can take a look.
Give me point in code, where this happens and some description.@zdm We should pass
compiler.outputFileSystemto here - https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/src/parseUtils.js#L9 and use it insteadfs, starting from - https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/src/BundleAnalyzerPlugin.js#L55, we havecompilerin this scopeI'd like to work on this. The fix detects
memfsused by webpack-dev-server 4 by checking the__volproperty onoutputFileSystemand returnsnullto prevent reading from disk. PR: #712I tested. it works and PR can be merged. Thank you.
- added a commit that references this issue
on Mar 18, 2026
Metadata
Metadata
Assignees
Type
Fields
Priority
Issue description
I got errors when using bundle analyzer wit the webpack dev server 4.
This happens only, when running under dev server, regular build completes normally.
Technical info
System: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 5.88 GB / 15.78 GB Binaries: Node: 16.10.0 - d:\devel\node\node.exe npm: 7.20.2 - ~\.npm\npm.cmd webpack: 5.55.1 webpack-dev-server: 4.3.0 webpack-bundle-analyzer: 4.4.2Debug info
I am using it as plugin with the following options:
What other Webpack plugins were used?