Skip to content

[Web] ReferenceError: 'self' is not defined #17421

@hunnble

Description

@hunnble

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)

Metadata

Metadata

Assignees

Labels

platform:webissues related to ONNX Runtime web; typically submitted using template

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions