Skip to content

Failing to fetch() Wasm retries the network request #25132

@verhovsky

Description

@verhovsky

If the fetch() fails (no network, 404, whatever) here

emscripten/src/preamble.js

Lines 607 to 608 in 7ed425e

var response = fetch(binaryFile, {{{ makeModuleReceiveExpr('fetchSettings', "{ credentials: 'same-origin' }") }}});
var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);

it will be retried, regardless of why it failed here

return instantiateArrayBuffer(binaryFile, imports);

var response = await fetch(url, {{{ makeModuleReceiveExpr('fetchSettings', "{ credentials: 'same-origin' }") }}});

The retry logic shouldn't retry the network call, because the end result is that if you pass a bad URL or serve a broken Wasm file it gets requested twice, just to make sure.

Image Image

(See also tree-sitter/tree-sitter#4775 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions