-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@parcel/resolver-default: Could not load './dist/ort-web.min.js' from module 'onnxruntime-web' found in package.json#browser #19915
Comments
I have exactly the same issue. After installing the package as described here (tried both ways) :
The following error occurs when trying to build the project with parcel, because apparently the required ort-web.min.js is not anywhere near (please find two attached screenshots below). Removing the "browser" property from the package.json as suggested in #20021 leads me to another error massage related to the "main" property, pointing to another unexisting file, removing which in it's turn, just leads to nothing - ort is just undefined after all:
. |
@paramonych thanks for your feedback. Could you try if this fixes the problem? |
### Description Field "browser" is deprecated in favor of "exports". Removes the unused field. Some bundler may read from "browser" and generate errors. Removing this field should let bundler to look up "exports". Fixes #19915
I have the same problem in React Native project, everything works fine for native apps, but for web it can't resolve modules. Also enabling new exports support is not possible in my project (it breaks a lot of other dependencies) |
could you help to check if adding back the "browser" field to "./dist/ort.min.js" help to fix? If so, I can make another change for adding it back. |
### Description As described in latest discussion in #19915, parcel v2 without using the [new resolver](https://parceljs.org/blog/v2-9-0/#new-resolver) will not work correctly with onnxruntime-web. There are still users who uses parcel with default resolver, so add this deprecated field "browser" back for backward compatibility. This PR also corrects the "main" field, which is for old resolver for Node.js.
### Description Field "browser" is deprecated in favor of "exports". Removes the unused field. Some bundler may read from "browser" and generate errors. Removing this field should let bundler to look up "exports". Fixes microsoft#19915
### Description As described in latest discussion in microsoft#19915, parcel v2 without using the [new resolver](https://parceljs.org/blog/v2-9-0/#new-resolver) will not work correctly with onnxruntime-web. There are still users who uses parcel with default resolver, so add this deprecated field "browser" back for backward compatibility. This PR also corrects the "main" field, which is for old resolver for Node.js.
### Description Field "browser" is deprecated in favor of "exports". Removes the unused field. Some bundler may read from "browser" and generate errors. Removing this field should let bundler to look up "exports". Fixes microsoft#19915
### Description As described in latest discussion in microsoft#19915, parcel v2 without using the [new resolver](https://parceljs.org/blog/v2-9-0/#new-resolver) will not work correctly with onnxruntime-web. There are still users who uses parcel with default resolver, so add this deprecated field "browser" back for backward compatibility. This PR also corrects the "main" field, which is for old resolver for Node.js.
Describe the issue
When you using parcel and latest version of onnxruntime-web (1.17.1), I am getting following error
@parcel/resolver-default: Could not load './dist/ort-web.min.js' from module 'onnxruntime-web' found in package.json#browser
seems like package.json has "browser": "dist/ort-web.min.js", which doesn't exist.
Thanks
To reproduce
Use latest version of onnxruntime-web (1.17.1)
and import as below
import {env, InferenceSession, Tensor} from 'onnxruntime-web';
When using parcel to start dev, the error is observed
Urgency
No response
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.1
Execution Provider
Other / Unknown
The text was updated successfully, but these errors were encountered: