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.

scheduler.development.js:107 Uncaught TypeError: callback is not a function

See original GitHub issue

Description

callback is not a function when update gatsby related packages and react to latest.

Steps to reproduce

repositories: https://github.com/FengShangWuQi/fengshangwuqi.github.io

1、npm run check // update all packages to latest 2、npm start // start project

Expected result

open page with no error

Actual result

callback is not a function

Environment

  System:
    OS: macOS 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    npm: 6.11.3 - /usr/local/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 76.0.3809.132
    Safari: 12.1.2
  npmPackages:
    gatsby: 2.15.16 => 2.15.16 
    gatsby-image: 2.2.19 => 2.2.19 
    gatsby-plugin-emotion: 4.1.6 => 4.1.6 
    gatsby-plugin-feed: 2.3.12 => 2.3.12 
    gatsby-plugin-google-analytics: 2.1.16 => 2.1.16 
    gatsby-plugin-offline: 3.0.7 => 3.0.7 
    gatsby-plugin-page-creator: 2.1.17 => 2.1.17 
    gatsby-plugin-react-helmet: 3.1.7 => 3.1.7 
    gatsby-plugin-sharp: 2.2.22 => 2.2.22 
    gatsby-plugin-svgr: 2.0.2 => 2.0.2 
    gatsby-plugin-twitter: 2.1.6 => 2.1.6 
    gatsby-plugin-typescript: 2.1.8 => 2.1.8 
    gatsby-plugin-typography: 2.3.7 => 2.3.7 
    gatsby-remark-autolink-headers: 2.1.10 => 2.1.10 
    gatsby-remark-copy-linked-files: 2.1.19 => 2.1.19 
    gatsby-remark-emojis: 0.3.2 => 0.3.2 
    gatsby-remark-external-links: 0.0.4 => 0.0.4 
    gatsby-remark-images: 3.1.22 => 3.1.22 
    gatsby-remark-prismjs: 3.3.13 => 3.3.13 
    gatsby-remark-responsive-iframe: 2.2.16 => 2.2.16 
    gatsby-remark-smartypants: 2.1.8 => 2.1.8 
    gatsby-source-filesystem: 2.1.22 => 2.1.22 
    gatsby-transformer-remark: 2.6.22 => 2.6.22 
    gatsby-transformer-sharp: 2.2.14 => 2.2.14 
  npmGlobalPackages:
    gatsby-cli: 2.7.47

react

react: 16.9.0
react-dom: 16.9.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
thomascorthoutscommented, Sep 18, 2019

I got the same error while working locally (running gatsby develop):

Screenshot 2019-09-18 at 12 53 09

It was fixable by downgrading react & react-dom like this

react: 16.9.0 -> 16.8.6
react-dom: 16.9.0 -> 16.8.6

I’m not 100% sure, but it might be because of a mismatch in scheduler versions (like the error page suggests), e.g. running npm list scheduler w/ react & react-dom upgraded resulted in this: Screenshot 2019-09-18 at 12 48 46

And after downgrading, they matched again: Screenshot 2019-09-18 at 12 46 38

1reaction
thomascorthoutscommented, Sep 19, 2019

Hey @FengShangWuQi

Nice to hear this fixed the issue for you, I’m going to reopen the issue as it is something Gatsby needs to be aware of as it raises the question of how we want to fix this. e.g. setting a specific peer dependency version vs. upgrading the scheduler in gatsby-cli. Maybe @wardpeet knows whether this is on the short-term planning for the team (Sorry Ward if you weren’t the person to drag in) I’d be fine with helping to resolve this issue in general, I would just need to know what the preferred approach would be.

Read more comments on GitHub >

github_iconTop Results From Across the Web

scheduler callback is not a function · Issue #16364 - GitHub
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 ...
Read more >
node.js - this problem TypeError: callback is not a function
Looks like an issue with the version of your scheduler module. Try uninstalling your scheduler module using, npm uninstall scheduler --save.
Read more >
TypeError: callback is not a function in JavaScript | bobbyhadz
The "callback is not a function" error occurs when we define a callback parameter to a function, but invoke the function without passing...
Read more >
Callback is not a function node, TypeError: callback is not a function ...
A callback is a function called at the completion of a given task; this prevents any blocking, and allows other code to be...
Read more >
Callback error on start #1000 - Issuehunt
Uncaught TypeError : callback is not a function at flushFirstCallback (scheduler.development.js:107) at flushWork (scheduler.development.js:219) at ...
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