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
Vite will error if node:'s value is null. This is strange because it shouldn't be checking this value but going straight to "import": "./dist/ort.webgl.min.mjs",. If I change it to any working path (e.g. "/types.d.ts") then it won't blow up and will correctly resolve to "import": "./dist/ort.webgl.min.mjs",. So this does work:
And if I can stop it from checking the node path initially by swapping the order, then it works also (no build error). Note that "import": "./dist/ort.webgl.min.mjs", is now before "node": null:
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
I don't think that's how null works. If you're in node and it matches null, it means that that entrypoint cannot be imported in node. Otherwise, what is the point of "node": null if Vite would skip it anyways? (as in if the field being removed would yield the same result in node).
Describe the bug
I am trying to build a project with this line:
when I go to build I get this error:
The issue is with the exports of this particular package.json (excerpt from original).
!!! Note that the node condition for webgl is null: !!!
Vite will error if
node:
's value isnull
. This is strange because it shouldn't be checking this value but going straight to"import": "./dist/ort.webgl.min.mjs",
. If I change it to any working path (e.g."/types.d.ts"
) then it won't blow up and will correctly resolve to"import": "./dist/ort.webgl.min.mjs",
. So this does work:And if I can stop it from checking the node path initially by swapping the order, then it works also (no build error). Note that
"import": "./dist/ort.webgl.min.mjs",
is now before"node": null
:Reproduction
see steps
Steps to reproduce
Add the package:
npm add -D onnxruntime-web
Try importing a nested path:
import * as ort from "onnxruntime-web/webgl";
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: