Skip to content

Deno failed to run with WasmGC #22861

@magic-akari

Description

@magic-akari

Version:

deno 1.41.2 (release, aarch64-apple-darwin)
v8 12.1.285.27
typescript 5.3.3

Search words:

  • WasmGC
  • WASM Reference types

Minimal reproducible code:

import init, { format } from "npm:@wasm-fmt/dart_fmt";

await init();

const input = `void main() { print('Hello, World!'); }`;

const formatted = format(input, "main.dart");
console.log(formatted);

Expected output:

void main() {
  print('Hello, World!');
}

Actual output:

error: Uncaught (in promise) Exception [WebAssembly.Exception] {}

Note: as WasmGC will introduced and enabled in Node@22, which has not been released yet, I am unable to verify its proper functioning within Node.
However, the following code has been confirmed to run successfully in Chrome.

<!DOCTYPE html>
<html lang="en">

<body>
    <script type="module">
        import init, { format } from "https://cdn.jsdelivr.net/npm/@wasm-fmt/dart_fmt/+esm";

        await init();

        const input = `void main() { print('Hello, World!'); }`;

        const formatted = format(input, "main.dart");
        console.log(formatted);
    </script>
</body>

</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs discussionthis topic needs further discussion to determine what action to takeupstreamChanges in upstream are required to solve these issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions