-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Could not find a declaration file for module '@gltf-transform/core' [Node.js/Typescript] #824
Comments
Comparing package.json before/after v3.0 —
The type definitions are there, in |
I found an issue thread about pony-cause here.
As you mentioned, your I actually just went down the ESM road because version 3.0.0 cannot be used with Node.JS and 'CommonJS' any longer:
|
Hi @donmccurdy, sorry for the delay.
I did and my package.lock now contains:
I update the repo mentioned above accordingly. Running
At this point I had to declare my imports with for instance UpdateI just checked with |
I've published v3.0.1 as a stable release, with the same contents as the |
as far as I understand the solution is to 'type' the imported modules with extensions. This is required for typescript with module settings 'Node16' and beyond. Basically, you need to add 'js' to all imported (typescript) files. So this
yes, it does. I'd rather stay with CommonJS since there is more than one tool/workflow that is not compatible with ESM as of now.
yes, exactly. Thanks again, great library, great support, great work! |
When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See developit/microbundle#1019 (comment) and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on donmccurdy/property-graph#70 and donmccurdy/KTX-Parse#55 Fixes donmccurdy#824
When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See developit/microbundle#1019 (comment) and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on donmccurdy/property-graph#70 and donmccurdy/KTX-Parse#55 Fixes donmccurdy#824
When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See developit/microbundle#1019 (comment) and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on donmccurdy/property-graph#70 and donmccurdy/KTX-Parse#55 Fixes donmccurdy#824
When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See developit/microbundle#1019 (comment) and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on donmccurdy/property-graph#70 and donmccurdy/KTX-Parse#55 Fixes donmccurdy#824
When importing this library in a project using moduleResolution nodenext, the types would give errors because the import paths were missing the file extension which is required for moduleResolution nodenext. Therefore we have to add .js to all imports of local files. See developit/microbundle#1019 (comment) and the issues that comment links to for some more detailed explanation of this. I also changed moduleResolution to nodenext in the tsconfig because when it's set to node, typescript won't give errors for missing file extensions which means they are easy to forget. With it set to nodenext, you will get an error if an import is missing the file extension. As far as I can see, changing this doesn't change the build output. Depends on donmccurdy/property-graph#70 and donmccurdy/KTX-Parse#55 Fixes #824
I can confirm that a minimal example of a module-typed package.json with typescript settings |
Describe the bug
@gltf-transform/core and @gltf-transform/extension cannot be imported when using
"module": "NodeNext"
and"target": "ESNext"
intsconfig.json
. You can find the compiler output in the next section. This setup does not work with version 3.0.0 but builds with version 2.5.1 (requires to also installdraco3dgltf
and its types first).To Reproduce
I set up a minimal project you can find here
package.json
tsconfig.json
src/main.ts
Steps to reproduce
git clone git@github.com:aleneum/gltf-test.git cd gltf-test npm install npm run build
Output
Expected behavior
Import should work
Versions:
The text was updated successfully, but these errors were encountered: