The issue involves browser-specific behavior and source map handling.
The issue involves React DevTools injecting its own code and attempting to download its source map, which triggers warnings in Firefox. The problem appears to be related to Firefox's handling of relative source map URLs. The solution may require changes to how source maps are handled or injected, but the scope and impact on other browsers are unclear.
React Dev Tools injects its own js code (installHook.js) and then tries to download the source map of its own code. Since my app does not know about installHook.js it can not generate the source map. So far, no harm done. But then, I get that huge warning in my console. And I google... And I chatGPT, dive into the deep realms of generating source maps, ...and after wasting an hour... find out by digging into the source code of the dev tools, that someone was too lazy to filter out your own files. The internet is full of this problem. It is time to fix it.
React version: 19.0.0
Link to code example: I tried using CodeSandbox, CodeSandbox itself is filling my console with warnings... Just execute a good old google query: https://www.google.com/search?q=installhook.js.map
Serve your own installHook.js.map file. I put one in the public directory of my react app. Contents:
{
"version": 3,
"file": "installHook.js",
"sources": ["installHook.js"],
"sourcesContent": [""],
"mappings": ""
}
I don't see a warning.
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!