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

deno.land being inaccessible breaks application #20233

Closed
ghost opened this issue Aug 22, 2023 · 3 comments
Closed

deno.land being inaccessible breaks application #20233

ghost opened this issue Aug 22, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 22, 2023

For some reason, deno.land being down breaks my application; this is a big problem.

error: Uncaught CompileError: WebAssembly.Module(): expected magic word 00 61 73 6d, found 35 30 30 3a @+0
  wasm_mod = new WebAssembly.Module(await ('file:' === path.protocol ? Deno.readFile(path) : fetch(path).then(r => r.arrayBuffer())));
             ^
    at https://deno.land/x/imagescript@1.2.15/utils/wasm/png.js:6:14
    at eventLoopTick (ext:core/01_core.js:181:11)

The import that triggers this:

import {decode, Image} from "https://deno.land/x/imagescript@1.2.15/mod.ts";

When I visit https://deno.land/x/imagescript@1.2.15/utils/wasm/png.js, I get a 500 error:

Screen Shot 2023-08-22 at 4 40 50 PM

How can I prevent this from being a problem in the future?

@sigmaSd
Copy link
Contributor

sigmaSd commented Aug 22, 2023

Its a remote import so the server failing will always be show stopper, so I think the only to prevent this is to vendor your dependencies

@bradenmacdonald
Copy link

If you use a dependency that requires WebAssembly/wasm code, Deno does not "know" about the wasm file import and needs to fetch it over the internet every time. Follow the issue #2552 to know when wasm imports have been implemented in Deno. Once that has been implemented, you could get your dependencies updated to use the new import method, and this problem should go away.

Until then, the only other option as pointed out is to have a full local ("vendored") copy of your dependency including its wasm module files.

@lucacasonato
Copy link
Member

#2552

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

No branches or pull requests

3 participants