React: Incorrect scheduler dependency getting installed for 16.7 alpha

Created on 9 Nov 2018  路  3Comments  路  Source: facebook/react

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:

  1. Create a React App (create-react-app)
  2. Update React and React DOM to the alpha version (16.7.0-alpha.0)
  3. Update 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.

Most helpful comment

Worked for me too, thanks! Using yarn, I added it as a version resolution to package.json.

"resolutions": {
  "scheduler": "0.11.0-alpha.0"
}

All 3 comments

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"
}
Was this page helpful?
0 / 5 - 0 ratings