Skip to content
Snippets Groups Projects
Commit 7d362e8e authored by amesgen's avatar amesgen Committed by Cheng Shao
Browse files

wasm: prevent bundlers from resolving import("node:timers")

This fixes the following esbuild error:

    ✘ [ERROR] Could not resolve "node:timers"

        www/ghc_wasm_jsffi.js:66:25:
          66 │     return (await import("node:timers")).setImmediate;
             ╵                          ~~~~~~~~~~~~~

      The package "node:timers" wasn't found on the file system but is built into node. Are you trying
      to bundle for node? You can use "--platform=node" to do that, which will remove this error.

Previously (i.e. after !13503), one had to work around this by passing
`--external:node:timers`.

(cherry picked from commit f6493dbc)
parent e11933d6
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,9 @@ const setImmediate = await (async () => {
// deno
if (globalThis.Deno) {
return (await import("node:timers")).setImmediate;
try {
return (await import("node:timers")).setImmediate;
} catch {}
}
// https://developer.mozilla.org/en-US/docs/Web/API/Scheduler/postTask
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment