DataUrl can't be generated automatically, because there is no mimetype for
See original GitHub issueBug report
What is the current behavior? I activate persistent cache and see this error:
DataUrl can't be generated automatically, because there is no mimetype for "" in mimetype database. Either pass a mimetype via "generator.mimetype" or use type: "asset/resource" to create a resource file instead of a DataUrl
I’ve tracked the input and it is already a Data URL base64, like data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAA…
.
If the current behavior is a bug, please provide the steps to reproduce.
There’s no such error without persistent cache, so I belive this to be a bug. I have this on private codebase, but I think the reproduction would be to use data urls in webpack-handled files. One of our flawed assets come from import 'react-image-crop/dist/ReactCrop.css';
which in turn uses data url in url()
.
What is the expected behavior? No error in console.
For bugged asset this line got empty string without persistent cache and { encoding: undefined, mimetype: undefined }
with persistent cache.
Other relevant information: webpack version: 5.52 Node.js version: 14.17 Operating System: GNU/Linux Additional tools:
Issue Analytics
- State:
- Created 2 years ago
- Comments:30 (15 by maintainers)
Top GitHub Comments
The fix is working ok on our big codebase. Thanks.
@StreetStrider reproduced, thanks