Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NoHatCoder opened this issue Jun 19, 2024 · 3 comments
Closed

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

NoHatCoder opened this issue Jun 19, 2024 · 3 comments
Labels

Comments

@NoHatCoder
Copy link

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

@NoHatCoder NoHatCoder added the bug label Jun 19, 2024
@HerrCai0907
Copy link
Member

Let me confirm the bug case, please correct me if I misunderstand.

in line 979, during compile wasm, browser throw a exception and catched by 980. And then go to the nodejs readfile part and cause the weird error log. right?

@NoHatCoder
Copy link
Author

Yes, and the lines in question have of course been transplanted from the js.ts file, where they are just strings, to the accompanying js file that the AS compiler generates.

@HerrCai0907
Copy link
Member

should be fixed in #2855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants