Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Whenever I try to use concurrent mode on React, one Cannot read property 'didTimeout' of undefined error is thrown.
If the current behavior is a bug, please provide the steps to reproduce:
create-react-app)index.js:import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
One error is thrown:
Uncaught TypeError: Cannot read property 'didTimeout' of undefined
at performAsyncWork (react-dom.development.js:19646)
at flushFirstCallback (scheduler.development.js:94)
at flushWork (scheduler.development.js:201)
at idleTick (scheduler.development.js:556)
What is the expected behavior?
To render correctly on concurrent mode.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Chrome: 70.0.3538.77
React: 16.7.0-alpha.0
ReactDOM: 16.7.0-alpha.0
It doesn't work without <StrictMode /> either.
In synchronous React, StrictMode works correctly.
Hi, I think it's caused by [email protected], I tried installing [email protected] manually and removing node_modules/react-dom/node_modules/scheduler folder, and my app can run again
EDIT: it would be better to install [email protected], that's what [email protected] depends on originally, and [email protected] breaks it. To avoid making the manual fix each time, you can follow: https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions
@Bobgy Thank you. It works for me
Worked for me too, thanks! Using yarn, I added it as a version resolution to package.json.
"resolutions": {
"scheduler": "0.11.0-alpha.0"
}
Most helpful comment
Worked for me too, thanks! Using yarn, I added it as a version resolution to
package.json.