Skip to content

node:fs/promises fallback thingy eats errors in the browser #2853

Closed
@NoHatCoder

Description

@NoHatCoder

Bug description

I tried running a program in a browser, and I get a completely nonsensical error in the console. What happened was that the server had set the wrong MIME type for the wasm file. But that error was caught by the JavaScript scaffold, and instead a piece of code that could only work in Node was run in its place, producing a completely unrelated error.

Offending code is located here:

try { return await globalThis.WebAssembly.compileStreaming(globalThis.fetch(url)); }

Steps to reproduce

Break the loading of the wasm file in any way. Then observe that the error message has nothing to with this break.

AssemblyScript version

v0.27.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions