Skip to content

#onnxruntime-webgpu alias does not resolve for parcel #986

@PoorRican

Description

@PoorRican

System Info

"@huggingface/transformers": "^3.0.0",
"@parcel/config-webextension": "^2.9.3",
"parcel": "^2.9.3",

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

The following error is returned when attempting to build the webextension:

@parcel/core: Failed to resolve '#onnxruntime-webgpu' from './node_modules/@huggingface/transformers/src/backends/onnx.js'

  .../node_modules/@huggingface/transformers/src/backends/onnx.js:29:27
    28 | // @ts-ignore
  > 29 | import * as ONNX_WEB from '#onnxruntime-webgpu';

Overwriting the import to onnxruntime-web fixes the issue.

Reproduction

  1. Create project with parcel, @parcel/config-webextension, and @huggingface/transformers.
  2. Create basic manifest.json
  3. Create a file which imports from @huggingface/transformers
  4. Run parcel build ./src/manifest.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions