microsoft / microsoft/onnxruntime

[Web] ReferenceError: 'self' is not defined

Open
#17,421 3 comments 0 reactions 1 assignee View on GitHub

@fs-eire is already working on this.

Since Sep 6, 2023.

platform:web
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

Describe the issue

When use ort to use pretrained model in browser, throw ReferenceError: 'self' is not defined.

To reproduce

pnpm install onnxruntime-web@1.15.1

then call:

import * as ort from 'onnxruntime-web';
const session = await ort.InferenceSession.create('./best.onnx');
Urgency

is urgent.

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

onnxruntime-web@1.15.1

Execution Provider

'webgl' (WebGL), 'wasm'/'cpu' (WebAssembly CPU)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.