WASM version of SWC.RC errors only in debug mode

NOTE: This is a bare bones example just to illustrate the problem: we aren't transpiling anything just getting the wasm to init.

basic setup:


  • swc.ts:
    import init from "https://esm.sh/@swc/wasm-web";
    await init();
  • .vscode/launch.json:
    {"configurations": [{"name": "debug", "request": "attach", "type": "node"}]}
## steps:
In the CLI run:
deno run -A swc.ts

It should just run and quit OK with no errors.

Next in the CLI run with a debug flag:
deno run -A --inspect-wait swc.ts

and then attach the debugger (vscode: "Run and debug" the configured debugger ["debug"]).
You should see the console error:
error: Uncaught (in promise) TypeError: WebAssembly.compile(): Argument 0 must be a buffer source
    at eventLoopTick (ext:core/01_core.js:168:7)
Was this page helpful?