Docz: Callback error on start

Created on 9 Aug 2019  路  11Comments  路  Source: doczjs/docz

Callback error on start

Describe the bug

Upon starting docz dev an error pops, it goest away but is still showing in the console

To Reproduce

  1. Start a fresh docz 2.0rc
  2. Once localhost starts you get the error
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)
pending-user-response v2

Most helpful comment

Hi @fraincs , just ran into this as well.
According to https://github.com/facebook/react/issues/15647 the fix is to add
"scheduler": "0.14.0" as a dependency. This solved the issue for me. Could you verify? If so, I'll shoot in a PR

All 11 comments

Hi @fraincs , just ran into this as well.
According to https://github.com/facebook/react/issues/15647 the fix is to add
"scheduler": "0.14.0" as a dependency. This solved the issue for me. Could you verify? If so, I'll shoot in a PR

@patricksevat That solved this issue for me.

Thx for letting me know @will-stone, I'll leave the implementation of this fix to @pedronauck as the current dev setup of docz v2 errors in my local set-up (probably some windows issue)

I ran into the same error when trying to use React hooks. I'm still on [email protected], and adding [email protected] helped workaround this issue.

@patricksevat That solved this issue for me too.

Just tried and had to apply same fix, since this is a showstopper, meanwhile is needed to launch the project I think it should be added to the getting started guide.

Should be fixed by : https://github.com/pedronauck/docz/commit/84918d8ac4fd11b2f69b065c786ca81217ce8d68

Will update here when the next version is released.

Meanwhile installing the latest scheduler version to your project should fix it.

This happens because gatsby has an optional dependency on ink which has a dependency on scheduler 0.13.2 which breaks with newer React versions.

Released as version 2.0.0-rc.5
Please let me know if it fixes this issue for you 馃憤

Closing this as resolved, feel free to re-open it if the issue happens again.

hmm... started a new project with docz and suddenly (yay) after I've added astroturf package i started getting this error. removing the package did not help.
I'm currently using [email protected], here're the relevant parts of package.json and yarn.lock



package.json

{
  "devDependencies": {
    "astroturf": "^0.9.17",
    "docz": "^2.0.0-rc.40",
    "prop-types": "^15.7.2",
    "react": "^16.9.0",
    "react-dom": "^16.9.0"
  }
}



yarn.lock (irrelevant parts omited)

[email protected], docz@^2.0.0-rc.40:
  version "2.0.0-rc.40"
...
  dependencies:
...
    scheduler "^0.15.0"
...

ink@^2.3.0:
  version "2.3.0"
...
  dependencies:
...
    scheduler "^0.13.2"
...

react-dom@^16.9.0:
  version "16.9.0"
...
  dependencies:
...
    scheduler "^0.15.0"

react-reconciler@^0.20.0:
  version "0.20.4"
...
  dependencies:
...
    scheduler "^0.13.6"

scheduler@^0.13.2, scheduler@^0.13.6:
  version "0.13.6"
...

scheduler@^0.15.0:
  version "0.15.0"
...


yarn why scheduler

$ yarn why scheduler
yarn why v1.17.3
[1/4] 馃  Why do we have the module "scheduler"...?
[2/4] 馃殮  Initialising dependency graph...
[3/4] 馃攳  Finding dependency...
[4/4] 馃殹  Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "scheduler"
info Reasons this module exists
   - Hoisted from "docz#gatsby#gatsby-cli#ink#scheduler"
   - Hoisted from "docz#gatsby#gatsby-cli#ink#react-reconciler#scheduler"
info Disk size without dependencies: "128KB"
info Disk size with unique dependencies: "212KB"
info Disk size with transitive dependencies: "236KB"
info Number of shared dependencies: 3
=> Found "docz#[email protected]"
info This module exists because "docz" depends on it.
info Disk size without dependencies: "212KB"
info Disk size with unique dependencies: "296KB"
info Disk size with transitive dependencies: "320KB"
info Number of shared dependencies: 3
=> Found "react-dom#[email protected]"
info This module exists because "react-dom" depends on it.
info Disk size without dependencies: "212KB"
info Disk size with unique dependencies: "296KB"
info Disk size with transitive dependencies: "320KB"
info Number of shared dependencies: 3

UPD: adding

"resolutions": {
    "scheduler": "0.15.0"
  }

helps

Same issue. Pinning schedular to 0.15.0 resolved foe me too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bugzpodder picture bugzpodder  路  26Comments

pedronauck picture pedronauck  路  68Comments

ivan-dalmet picture ivan-dalmet  路  83Comments

godmar picture godmar  路  24Comments

ohardy picture ohardy  路  24Comments