microsoft / onnxjs

ONNX.js: run ONNX models using JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error TS2304: Cannot find name 'Platform'.

cateiru opened this issue · comments

Hello.

I got this error when I cloned this repository and did the build.

$ yarn build                                                                                                                                                                                                                                                                                                                                     
yarn run v1.22.4
$ tsc && node tools/build --build-wasm --build-bundle
lib/env.ts:9:22 - error TS2304: Cannot find name 'Platform'.

9   readonly platform: Platform;
                       ~~~~~~~~

lib/env.ts:9:22 - error TS4033: Property 'platform' of exported interface has or is using private name 'Platform'.

9   readonly platform: Platform;
                       ~~~~~~~~


Found 2 errors.

After detailed verification, it seems that this error occurs when installing @types/platform version 1.3.3.
Specifying the version of @types/platform to 1.3.2 in package.json would solve the problem, but I don't think this is a good idea. Is there any way to do this?

Changes in @types/platform(1.3.3)