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.

Error: Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.

See original GitHub issue

Since I updated to the latest version, I get this error:

Error: Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.
×
Error: Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.
▼ 38 stack frames were expanded.
readFromUnsubcribedMutableSource
node_modules/react-dom/cjs/react-dom.development.js:16038
(anonymous function)
node_modules/react-dom/cjs/react-dom.development.js:16058
mountState
node_modules/react-dom/cjs/react-dom.development.js:16199
useState
node_modules/react-dom/cjs/react-dom.development.js:16825
useMutableSource
node_modules/react-dom/cjs/react-dom.development.js:16057
mountMutableSource
node_modules/react-dom/cjs/react-dom.development.js:16186
useMutableSource
node_modules/react-dom/cjs/react-dom.development.js:16848
useMutableSource
node_modules/react/cjs/react.development.js:1621
useRecoilValueLoadable_MUTABLESOURCE
node_modules/recoil/es/recoil.js:2004
useRecoilValueLoadable
node_modules/recoil/es/recoil.js:2064
useRecoilValue
node_modules/recoil/es/recoil.js:2084
useRecoilState
node_modules/recoil/es/recoil.js:2132
SwitchNiche
src/components/App/AdminBase/Avatar/SwitchNiche/index.jsx:11
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js:15543
mountIndeterminateComponent
node_modules/react-dom/cjs/react-dom.development.js:18436
beginWork
node_modules/react-dom/cjs/react-dom.development.js:19867
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js:3905
invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js:3954
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js:4016
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js:25031
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js:23765
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js:23685
renderRootSync
node_modules/react-dom/cjs/react-dom.development.js:23644
performSyncWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js:23215
(anonymous function)
node_modules/react-dom/cjs/react-dom.development.js:11544
unstable_runWithPriority
node_modules/scheduler/cjs/scheduler.development.js:647
runWithPriority$1
node_modules/react-dom/cjs/react-dom.development.js:11493
flushSyncCallbackQueueImpl
node_modules/react-dom/cjs/react-dom.development.js:11539
flushSyncCallbackQueue
node_modules/react-dom/cjs/react-dom.development.js:11526
commitRootImpl
node_modules/react-dom/cjs/react-dom.development.js:24292
unstable_runWithPriority
node_modules/scheduler/cjs/scheduler.development.js:647
runWithPriority$1
node_modules/react-dom/cjs/react-dom.development.js:11493
commitRoot
node_modules/react-dom/cjs/react-dom.development.js:23979
finishConcurrentRender
node_modules/react-dom/cjs/react-dom.development.js:23069
performConcurrentWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js:22992
workLoop
node_modules/scheduler/cjs/scheduler.development.js:591
flushWork
node_modules/scheduler/cjs/scheduler.development.js:546
MessagePort.performWorkUntilDeadline
node_modules/scheduler/cjs/scheduler.development.js:158

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andreypoppcommented, Aug 27, 2021

Just FYI I also had this bug but it’s gone now for me after I’ve updated to 0.4.1.

0reactions
drarmstrcommented, Dec 9, 2021

Mutable Source no longer used in open-source React.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Should have a queue. This is likely a bug in React ...
I am using react-i18next . Sometime on init function component facing React issue. Any idea what may causing it? My config import i18n...
Read more >
UNPKG - @inlet/react-pixi
... {\n {\n throw Error( \"Cannot read from mutable source during the current render without tearing. This is a bug in React. Please...
Read more >
Exploring React 18's three new APIs - LogRocket Blog
One of the APIs introduced in React v16.14.0 to accommodate concurrent rendering was useMutableSource , which was intended to allow React ...
Read more >
Safari Technology Preview Release Notes - Apple Developer
If you see bugs or unexpected behavior with the interface of Safari Technology Preview, please file feedback with Apple's Feedback Assistant.
Read more >
Writing efficient React code - Firefox Source Docs - Mozilla
Do not do heavy computations in your render methods. Rather do them before setting the state, and set the state to the result...
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