Skip to content

JavaScript: quick start with script tag does not work in ESM mode #373

@fdb

Description

@fdb

I'm trying to run the JavaScript examples, starting from the quick-start_onnxruntime-web-script-tag directory. This directory contains two versions:

This is the error:

failed to inference ONNX model: Error: no available backend found. ERR: [wasm] RuntimeError: Aborted(LinkError: import object field 'J' is not a Function). Build with -sASSERTIONS for more info., [cpu] Error: previous call to 'initializeWebAssembly()' failed., [webnn] Error: previous call to 'initializeWebAssembly()' failed., [xnnpack] Error: previous call to 'initializeWebAssembly()' failed..

Output of index_esm.html:

Screenshot 2024-01-25 at 12 16 46 Screenshot 2024-01-25 at 12 16 55

Output of index.html:

Screenshot 2024-01-25 at 12 21 59

Environment

The error appears in Firefox, Chrome and Safari. I'm running this on a MacBook Pro M2 Max in macOS Sonoma 14.2.1.

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