AukeA
Denoβ€’2y agoβ€’
24 replies
Auke

`deno run` not returning

Hi - I have added the following code to my javascript file, and for some reason the code still executes fine, but it doesn't return anymore, leaving deno running and I have to ctrl-c out of it.

if ("Deno" in window) {
  // Import paper_js, as it is not loaded by the index.html script include
  const paper_import = await import("npm:paper");
  const paper = paper_import.default;
  await import("npm:paper-jsdom");
  globalThis.paper = paper;
  paper.setup();
  console.log("setup paper");
}

This prints out the setup paper. I have added some prints surrounding my entry point main, and those all print as well:
console.log("doing");
try {
  await main();
  console.log("done!");
} catch (error) {
  console.error("An error occursed:", error);
} finally {
  // Keep the program running until all asynchronous operations are complete
  await new Promise((resolve) => setTimeout(resolve, 0));
  console.log("now done");
}
console.log("really done");

So what could be keeping the deno instance from returning/finishing?
Was this page helpful?