-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Webpack compilations fail when using filesystem cache #458
Comments
There is the minimal (small as possible) test to reproduce the issue issue-cache-filesystem-rebuild-image-minimizer. More details to the BugIf set
Prepare
How to reproduce the issue
How to fix
The
Webpack expected the exactly same filename in both objects newAssetInfo = mergeAssetInfo(data.get("assetInfo"), newAssetInfo); // <= here occurs error Very easy to debug it, just add if (data && data.get("assetInfo")) {
+ console.log({ assetInfo: data.get("assetInfo"), newAssetInfo });
newAssetInfo = mergeAssetInfo(data.get("assetInfo"), newAssetInfo);
} Output with
|
I will make a PR to fix the bug. |
Bug report
The plugin generates an absolute file path in
sourceFilename
, but webpack needs a filename of asset modules as relative path inside theoutput.path
directory. This behavior causes a compilation error when using the filesystem cache.Detailed review: webdiscus/html-bundler-webpack-plugin#130 (comment)
How reproduce and fix: https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/test/manual/cache-filesystem-rebuild-image-minimizer/README.md
Actual Behavior
If set
cache.type: 'filesystem'
in Webpack configuration, the first compilation will complete without errors. Subsequent compilations that use the filesystem cache will fail.Expected Behavior
A path to the source file in
sourceFilename
must be relative to the output.path directory.Compilation should complete without errors when using the file system cache.
How Do We Reproduce?
Use that test https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/test/manual/cache-filesystem-rebuild-image-minimizer
The first compilation will complete without errors. Subsequent compilations that use the filesystem cache will fail.
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationnpx webpack-cli info
:Upstream issue: webdiscus/html-bundler-webpack-plugin/issues/130
The text was updated successfully, but these errors were encountered: