Open jwalkerinterpres opened 3 months ago
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
React version: 18.3.1
Steps To Reproduce
onClick
)Link to code example:
Unfortunately the code involves like ten component files, a test file, some test helper files, etc. which I can't include here. Really, my code example isn't important to the ticket, but for reference the key bit is:
Which results in:
because of some unknown code being tested (if I knew what code I'd happily paste it here ... but then I wouldn't need to file this ticket).
In general , when React tells you something is wrong, it always tell you what is wrong, to the best of its ability. With many React errors you not only get a helpful error message, but there's even a link to a webpage with further info :)
With this error, the message tells you nothing useful, and even Googling tells you almost nothing (it has something to do with blocking actions inside
useEffect
?)React should (more politely) say:
A "react error documentation link" would certainly be nice, but even just an improved error message would be helpful.
The current behavior
With an unhelpful stacktrace that doesn't mention any of the files actually involved:
❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25742:11 ❯ flushActQueue node_modules/react/cjs/react.development.js:2667:24 ❯ act node_modules/react/cjs/react.development.js:2582:11 ❯ node_modules/@testing-library/react/dist/act-compat.js:47:25 ❯ renderRoot node_modules/@testing-library/react/dist/pure.js:180:26 ❯ render node_modules/@testing-library/react/dist/pure.js:271:10 ❯ renderHook node_modules/@testing-library/react/dist/pure.js:318:7
The expected behavior
This is an example; if I actually understood what this error meant, I'd write a PR with the new message, instead of this ticket.
(And then, ideally, you'd get a stack trace that takes you to the
useEffect
that caused this problem.)