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

Error fetching Wasm file over HTTPS #16002

Closed
GJZwiers opened this issue Sep 22, 2022 · 3 comments
Closed

Error fetching Wasm file over HTTPS #16002

GJZwiers opened this issue Sep 22, 2022 · 3 comments
Labels
bug Something isn't working correctly ext/fetch related to the ext/fetch

Comments

@GJZwiers
Copy link
Contributor

Source: https://discord.com/channels/684898665143206084/684898665151594506/1022408024725405698

The following code throws an error in Deno versions 1.17 and upwards:

const { instance, module } = await WebAssembly.instantiateStreaming(
  fetch("https://wpt.live/wasm/incrementer.wasm"),
);

const increment = instance.exports.increment as (input: number) => number;
console.log(increment(41));
deno run -A wasm.ts

Deno 1.16:

42

Deno 1.17:

error: Uncaught (in promise) Error: request or response body error: error reading a body from connection: unexpected end of file
    at async Object.pull (deno:ext/fetch/26_fetch.js:104:24)

Deno 1.25:

error: Uncaught (in promise) Error: request or response body error: error reading a body from connection: unexpected end of file
    at async Object.pull (deno:ext/fetch/26_fetch.js:119:24)
@ar37-rs
Copy link

ar37-rs commented Sep 22, 2022

const { instance, module } = await WebAssembly.instantiateStreaming(
  fetch("http://wpt.live/wasm/incrementer.wasm"),
);

change https:// to http:// working as expected, not sure why. i'm new to deno. @dsherret any idea?

@GJZwiers GJZwiers changed the title Error fetching Wasm file Error fetching Wasm file over HTTPS Sep 23, 2022
@dsherret dsherret added bug Something isn't working correctly ext/fetch related to the ext/fetch labels Sep 29, 2022
@eryue0220
Copy link

Maybe the problem is caused by the rustls, discussed in 13058. And is there any plan to fixed?

@GJZwiers
Copy link
Contributor Author

I think you are right @eryue0220, this is probably the same issue as #13058. Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ext/fetch related to the ext/fetch
Projects
None yet
Development

No branches or pull requests

4 participants