Skip to content
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

error TS2307: Cannot find module 'babylonjs-gltf2interface/.js' or its corresponding type declarations. #12330

Closed
gemron opened this issue Apr 2, 2022 · 6 comments
Assignees
Milestone

Comments

@gemron
Copy link

gemron commented Apr 2, 2022

Use Github issues ONLY for validated bugs. PLEASE DISCUSS THEM ON THE FORUM FIRST!

We have a really active forum to help answering questions (https://forum.babylonjs.com/)

Repro

node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.d.ts:11:32 
import type * as GLTF2 from "babylonjs-gltf2interface";
  • Current result:
 node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.d.ts:11:32 
 import type * as GLTF2 from "babylonjs-gltf2interface/.js";

it's suffix by "/.js" ,so error TS2307:Cannot find module 'babylonjs-gltf2interface/.js' or its corresponding type declarations.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] windows
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22] 5.0.2

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
when i install 5.0.0-rc.13, this is file node_modules/@babylonjs/loaders/glTF/2.0/glTFLoader.d.ts:11:32
is right, import type * as GLTF2 from "babylonjs-gltf2interface";

@sebavan
Copy link
Member

sebavan commented Apr 4, 2022

This has been fixed and should be all good in 5.0.3

@sebavan sebavan closed this as completed Apr 4, 2022
@sebavan sebavan reopened this Apr 4, 2022
@sebavan
Copy link
Member

sebavan commented Apr 4, 2022

@sebavan sebavan added this to the 5.0 milestone Apr 4, 2022
@RaananW
Copy link
Member

RaananW commented Apr 4, 2022

Validating and fixing, thanks for reporting

@RaananW
Copy link
Member

RaananW commented Apr 4, 2022

5.0.3 was just released and should be fine. Closing this bug, please reopen if there is any issue with it.

@RaananW RaananW closed this as completed Apr 4, 2022
@Dok11
Copy link
Contributor

Dok11 commented Jul 9, 2022

Same error:

node_modules/@babylonjs/loaders/glTF/2.0/glTFLoaderInterfaces.d.ts:8:29 - error TS2307: Cannot find module 'babylonjs-gltf2interface' or its corresponding type d
eclarations.

8 import type * as GLTF2 from "babylonjs-gltf2interface";

package.json

{
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/cdk": "^13.3.9",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@ngneat/until-destroy": "^9.0.0",
    "body-scroll-lock": "^4.0.0-beta.0",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "typed.js": "^2.0.12",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.3",
    "@angular/cli": "~13.2.3",
    "@angular/compiler-cli": "~13.2.0",
    "@babylonjs/core": "^5.14.1",
    "@babylonjs/loaders": "^5.14.1",
    "@types/body-scroll-lock": "^3.1.0",
    "@types/jasmine": "~3.10.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~4.0.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "local-web-server": "^5.1.1",
    "typescript": "~4.5.2"
  }
}

Error when import '@babylonjs/loaders/glTF/2.0/glTFLoader'; or import '@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression'; is in my code.

Manual installation npm i babylonjs-gltf2interface --save-dev is solving this issue.

@RaananW
Copy link
Member

RaananW commented Jul 11, 2022

Not the same error at all, this is because of a change we have made to peer-dependencies (vs. regular dependencies).
babylonjs-gltf2interface is a peer dependency of @babylonjs/loaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants