Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use @jupyterlab/services: setImmediate is not defined #856

Open
lawrencecchen opened this issue Apr 1, 2024 · 0 comments
Open

Cannot use @jupyterlab/services: setImmediate is not defined #856

lawrencecchen opened this issue Apr 1, 2024 · 0 comments

Comments

@lawrencecchen
Copy link
Contributor

Reproduction:

https://github.com/lawrencecchen/partykit-jupyter

This is because of these lines in @lumino/signaling:

Screenshot 2024-04-01 at 3 02 20 PM

Dependencies

"dependencies": {
    "@jupyterlab/services": "^7.1.5",
    "partysocket": "^1.0.1"
  },
  "devDependencies": {
    "partykit": "^0.0.100",
    "typescript": "^5.4.2"
  }

Logs

✘ [ERROR] service core:user:: Uncaught ReferenceError: setImmediate is not defined

    at src/server.ts:1422:47
    at src/server.ts:1423:11
    at src/server.ts:1451:9
    at src/server.ts:1177:72
    at src/server.ts:1178:7 in node_modules/@lumino/signaling/dist/index.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:3307:23 in node_modules/@jupyterlab/services/lib/basemanager.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:10787:18 in node_modules/@jupyterlab/services/lib/index.js
    at src/server.ts:18:50 in __require2


Error reloading local server: MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:8868:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:3420:16)
    at async #waitForReady (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:8925:5)
    at async MiniflareServer.onBundleUpdate (file:///Users/lawrencechen/fun/partykit-jupyter/node_modules/partykit/dist/bin.mjs:89063:20) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}

I also tried polyfilling setimmediate:

import type * as Party from "partykit/server";
import "setimmediate"
import { KernelManager, ServerConnection } from "@jupyterlab/services";

but another error appears:

✘ [ERROR] service core:user:: Uncaught Error: Dynamic require of "partykit-exposed-node-path" is not supported

    at src/server.ts:12:9
    at src/server.ts:2463:18 in node_modules/@jupyterlab/coreutils/lib/url.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:2541:17 in node_modules/@jupyterlab/coreutils/lib/pageconfig.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:2942:18 in node_modules/@jupyterlab/coreutils/lib/index.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:3310:24 in node_modules/@jupyterlab/services/lib/serverconnection.js
    at src/server.ts:18:50 in __require2
    at src/server.ts:3457:30 in node_modules/@jupyterlab/services/lib/basemanager.js


Error reloading local server: MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:8868:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Mutex.runWith (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:3420:16)
    at async #waitForReady (/Users/lawrencechen/fun/partykit-jupyter/node_modules/miniflare/dist/src/index.js:8925:5)
    at async MiniflareServer.onBundleUpdate (file:///Users/lawrencechen/fun/partykit-jupyter/node_modules/partykit/dist/bin.mjs:89063:20) {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant