-
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
New node packages ship TS source files #7949
Comments
@jakebailey thank you for the feedback. I didn't use ts-loader for Node.js before. For web, to generate bundles it is usually OK to recompile the typescript from dependencies, as the target library may have different output settings (es5/es6/es7, umd/mjs), so sometimes recompiling from source typescript code is better than consuming the bundle.min.js. Usually this does not cause any error, the only disadvantage is a longer build time. Does the typescript code in the NPM package causes ts-loader to behave unexpectedly (like fail to load the node binding)? If so, please share me the example so that I can take a look into the issue. |
This isn't the way that I've seen libraries do it, at least not so far. I don't know of any library that expects
My case is unique; in order to support using onnxruntime on all three supported platforms in a single bundle, I replace I noticed this issue because I will test to see how it works when I tell it to replace the https://github.com/TypeStrong/ts-loader#allowtsinnodemodules |
fix is done and a dev version package is published |
I tried it out, but it appears as though the common package is not quite right:
|
Yeah, it's still distributed as it was before. |
This is still a problem, even moreso in the web package where I get a pretty significant number of errors (which I'm now trying out as I'm hoping to drop needing any of the node bindings in favor of WASM). |
Describe the bug
I'm working on upgrading Pylance to use version 1.8.0; we use the onnxruntime binding for IntelliCode support.
I noticed when trying to move to the new package that the original TS source is getting shipped. I think this might have been an oversight; the types are provided via the
d.ts
files, and it's thejs
files that should be in the final npm package, not the original source. AFAIK, most TS libraries have their source in asrc
directory (which is npmignore'd), then compile to another directory, which avoids this problem. onnxruntime does not, and at some point during the package move, thets
files inlib
must have become unignored.This seems to cause ts-loader (used in Webpack to build TS code) to ignore the shipped
.js
files altogether, as it's resolving to the.ts
file first, then recompiling it. We have a webpack loader plugin in place to manage loading the multiple.node
bindings (for cross-platform support), and that's how I noticed that thejs
files were no longer being loaded.Urgency
No major urgency at the moment, 1.7.0 is working fine. I can technically work around the issue (that a file I override to manage the bindings is not a
js
file), but I don't think it makes sense for downstream projects to be recompiling the library during their builds.System information
(Not really relevant to this issue.)
To Reproduce
Do
npm install onnxruntime-node
, then look innode_modules/onnxruntime-core/lib
; thets
files are present. I can give you a larger webpack example if needed.Expected behavior
No source files are shipped
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.
The text was updated successfully, but these errors were encountered: