Description
Steps to reproduce
I don't know where the problem could be. Therefore I can't create an MRE.
This is a video I captured:
WrongEmptyStringAddress.mp4
The point is, the message complaints that:
An empty string ("") was passed to the src attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to src instead of an empty string.
When I open that message to see the stack, it guides me to a component of mine called ToggleView
and the line specified contains this code:
setViewStyle("cards")
And the ToggleView.jsx
does not contain src
attribute at all in it. Of course, I have src
in many other places. But how can I know which one is causing the problem? The address is wrong.
Current behavior
React provides misleading addresses that do not help at all in finding the problem, and litters the console for long time until we find the problem accidentally or through heuristics (trial & error).
Expected behavior
React should provide accurate addresses.
Your environment
System:
OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
Binaries:
Node: 22.12.0 - /usr/local/bin/node
npm: 11.0.0 - /usr/local/bin/npm
Browsers:
Firefox: 133.0.3 (64-bit)
npmPackages:
react: ^19.0.0 => 19.0.0
react-dom: ^19.0.0 => 19.0.0