question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataUrl can't be generated automatically, because there is no mimetype for

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:30 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
StreetStridercommented, Oct 20, 2021

The fix is working ok on our big codebase. Thanks.

1reaction
alexander-akaitcommented, Oct 17, 2021

@StreetStrider reproduced, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataUrl can't be generated automatically, because there is no ...
Electron Forge was terminated: CodeGenerationError: DataUrl can't be generated automatically, because there is no mimetype for ".pcss" in ...
Read more >
url-loader | webpack - JS.ORG
The true value allows to generation the mimetype part from mime-types. The false value removes the mediatype part from a Data URL (if...
Read more >
Data URLs - HTTP - MDN Web Docs - Mozilla
The mediatype is a MIME type string, such as 'image/jpeg' for a JPEG ... A data URL provides a file within a file,...
Read more >
img with src set to a data URI with an invalid mediatype not ...
Yes. It's due to my change r272022. The data URI parser in Chromium now checks if the mediatype part is a valid MIME...
Read more >
Data URIs | CSS-Tricks
(It's equally correct to say “Data URL”, which I think I prefer.) ... is encoded as if it were an HTML e-mail message,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found