You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tsc prints the following when type-checking a project that depends on onnxruntime-web 1.17.0. This did not happen with 1.16.x.
app/components/App.ts:3:22 - error TS7016: Could not find a declaration file for module 'onnxruntime-web'. '[…]/node_modules/onnxruntime-web/dist/esm/ort.min.js' implicitly has an 'any' type.
There are types at '[…]/node_modules/onnxruntime-web/types.d.ts', but this result could not be resolved when respecting package.json "exports". The 'onnxruntime-web' library may need to update its package.json or typings.
3 import * as ort from 'onnxruntime-web'
To reproduce
npx [email protected] --no-eslint --no-tailwind --ts --app --no-src-dir --import-alias '@/*'testcdtest
npm i onnxruntime-web
mkdir app/components
cat > app/components/App.ts <<EOF'use client'import * as ort from 'onnxruntime-web'export default function App() { console.log(ort.Tensor)}EOF
npx tsc
Make sure that tsconfig.json has "strict": true. If you change it so that it has "strict": false instead, the error goes away.
Urgency
This prevents using onnxruntime-web in default NextJS apps.
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.0
Execution Provider
'wasm'/'cpu' (WebAssembly CPU), 'webgpu' (WebGPU)
The text was updated successfully, but these errors were encountered:
### Description
Since TypeScript v4.7, types need to specify inside "exports" field when
it is available. This PR appends types just before each "default" (which
is required by spec to be the last item).
Fixes#19403.
### Description
Since TypeScript v4.7, types need to specify inside "exports" field when
it is available. This PR appends types just before each "default" (which
is required by spec to be the last item).
Fixes#19403.
siweic0
pushed a commit
to siweic0/onnxruntime-web
that referenced
this issue
May 9, 2024
### Description
Since TypeScript v4.7, types need to specify inside "exports" field when
it is available. This PR appends types just before each "default" (which
is required by spec to be the last item).
Fixesmicrosoft#19403.
Describe the issue
tsc
prints the following when type-checking a project that depends on onnxruntime-web 1.17.0. This did not happen with 1.16.x.To reproduce
Make sure that
tsconfig.json
has"strict": true
. If you change it so that it has"strict": false
instead, the error goes away.Urgency
This prevents using
onnxruntime-web
in default NextJS apps.ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.0
Execution Provider
'wasm'/'cpu' (WebAssembly CPU), 'webgpu' (WebGPU)
The text was updated successfully, but these errors were encountered: