-
Notifications
You must be signed in to change notification settings - Fork 231
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
Suffix all imports with .js
#1001
Comments
source: Node v18+ docs: https://nodejs.org/api/esm.html#mandatory-file-extensions "Mandatory file extensions |
I also noticed we use import statements without an extension throughout the codebase, in huggingface.js and internal projects as well. Maybe there is a rationale for that. If so, node can be made to work with extensionless imports using the "extensionless" package: |
Seems necessary for #1025 - also handle #1001 (only for tasks at the moment) cc @martin-gorner also so that https://arethetypeswrong.github.io/?p=@huggingface/tasks is :heavy_check_mark: cc @Pierrci - in addition to the .cts exports And finally export snippets types (https://github.com/huggingface-internal/moon-landing/pull/10998/files#r1841375306) Types pass: https://arethetypeswrong.github.io/?p=%40huggingface%2Ftasks%400.13.0-test5 !
So that we can run code in node after a basic
npx tsc
, without module compatibility problemscc @martin-gorner for viz
Later we can investigate other steps needed to debug a local file, until we reduce it to the minimal amount
The text was updated successfully, but these errors were encountered: