-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Deno hangs after succesfully executing npm-package library call #23727
Comments
I presume this is related to NAPI, as paper uses |
According to tokio-console this is getting stuck waiting for a timer but more investigation is needed to figure out exactly what timer. |
Deno fails to simulate Node.js in paper.js because it uses (In Deno, {
platform: 'mac',
mac: true,
version: '20.15.0',
versionNumber: 20.15,
name: 'node',
node: true
} If the platform is not Node.js, If Which calls polyfilled version of Which internally calls One of workarounds is deleting delete globalThis.self;
const paper_import = await import("paper");
const paper = paper_import.default;
globalThis.paper = paper;
paper.setup();
const pathdata = "M 0 0 C 0 10 10 10 10 0 z";
const path = new paper.Path(pathdata);
console.log({ path });
console.log(paper.agent); The above script exits immediately and prints |
One solution might be hiding |
Seems like a reasonable solution, |
Hi -
so I'm not sure if the PR to fix this issue actually fixes it. Using |
@aukeroorda Deno |
Thanks for informing me! I thought I updated recently, but apparently not that recently! It is indeed solved. |
> deno --version deno 1.41.3 (release, x86_64-apple-darwin) v8 12.3.219.9 typescript 5.3.3
MRE
Can be found at: https://github.com/aukeroorda/mre-deno-hang/tree/main
paper-js
library as specified in the package file:node_modules
:y
mre.ts
script, but Deno hangs.Note:
Deno doesn't hang anymore if the following lines 20 and 21 are commented out: https://github.com/aukeroorda/mre-deno-hang/blob/6c3d8d0f313141bff39ffc0906780189668b055d/mre.ts#L20-L21
Inspecting using chromium
I've tried to inspect what is going on with this library call using the chromium debugger, but I can't really see much, as the call gets 'hijacked' by a call to
node:timers
setInterval()
function, and I lose the trace of the library function call here.The text was updated successfully, but these errors were encountered: