react: scheduler callback is not a function
Do you want to request a feature or report a bug? Bug
What is the current behavior? After update react env from 16.8.6 -> 16.9.0 I catch errors:
scheduler.development.js:107 Uncaught TypeError: callback is not a function
at flushFirstCallback (scheduler.development.js:107)
at flushWork (scheduler.development.js:219)
at MessagePort../node_modules/scheduler/cjs/scheduler.development.js.channel.port1.onmessage (scheduler.development.js:611)
flushFirstCallback @ scheduler.development.js:107
flushWork @ scheduler.development.js:219
./node_modules/scheduler/cjs/scheduler.development.js.channel.port1.onmessage @ scheduler.development.js:611
What is the expected behavior? No errors
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Version 16.9.0 On 16.8.6 all works fine
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 20
For anybody having issues after deleting node_modules: Try verifying you only have a single
schedulerentry in the lockfile of your package manager. Foryarnuseyarn why schedulerand fornpmnpm list scheduler. It should only list a single one. Foryarnyou can just remove allschedulerentries and runyarnagain. This should result in a single entry. No idea aboutnpmother than manually merging the entries.Deleting both
node_modulesandpackage-lock.json(and thennpm i) fixed it for me.You probably forgot to update some of the packages. Ensure that you have 16.9.0 of both React and ReactDOM, for example. If this doesn’t help, try deleting
node_modulesand installing again.deleted node_modules, updated react and react-dom to 16.9.0, still having this issue. I am running it inside the gatsby project.
Walking around that issue I finded solution for my case (thanks all who leave a comment here) and only add:
Installing it explicitly at the top level is a bad idea and will only create more problems in the future, as the version you installed will get out of sync with the version used by React. Please don’t do that.
I have gatsby and react-dom installing two different versions of scheduler.
npm install --save schedulerwas the solution for my case.