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 when updating to r167 #1136

Closed
EdwardMoyse opened this issue Jul 30, 2024 · 4 comments
Closed

Error when updating to r167 #1136

EdwardMoyse opened this issue Jul 30, 2024 · 4 comments

Comments

@EdwardMoyse
Copy link

As per the title, I just updated to r167 e.g.

+++ b/packages/phoenix-event-display/package.json
@@ -45,14 +45,14 @@
     "jsroot": "^7.7.2",
     "jszip": "^3.10.1",
     "stats-js": "^1.0.1",
-    "three": "^0.165.0"
+    "three": "^0.167.0"
   },
   "devDependencies": {
     "@babel/helper-string-parser": "^7.24.7",
     "@babel/plugin-transform-runtime": "^7.24.7",
     "@compodoc/compodoc": "^1.1.25",
     "@types/dat.gui": "^0.7.13",
-    "@types/three": "^0.165.0",
+    "@types/three": "^0.167.1",
     "esbuild-loader": "^4.2.2",
     "jest": "^29.7.0",
     "ts-jest": "~29.2.3",

And now I see:

- Generating browser application bundles (phase: setup)...
../../node_modules/@types/three/examples/jsm/loaders/KTX2Loader.d.ts(2,42): error TS2307: Cannot find module 'three/webgpu' or its corresponding type declarations.
  There are types at '/Users/emoyse/LocalDocuments/phoenix/node_modules/@types/three/build/three.webgpu.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
2:29:16 PM - Found 1 error. Watching for file changes.
✔ Browser application bundle generation complete.

Since this is an error internal to three, I assume this is not my mistake?

@Methuselah96
Copy link
Contributor

Thanks for reporting the issue!

The issue is that KTX2Loader imports the WebGPURenderer type through the three/webgpu entrypoint, however TypeScript doesn't recognize that entrypoint when using outdated moduleResolution settings like node/node10.

One solution that you could apply on your end is to update the moduleResolution setting in your TSConfig to be 'node16', 'nodenext', or 'bundler'. It sounds like you're probably using node/node10 which should no longer be used. See this guide if you're not sure which one to use.

I'm not quite sure yet whether this is something we will try to workaround in @types/three, since I think the way we're currently doing it is correct.

Let me know if that helps!

@Methuselah96
Copy link
Contributor

I don't think there are any changes that it makes sense to do at this time, so closing this for now, but feel free to follow up if you think there's something for us to do.

@Methuselah96 Methuselah96 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2024
@EdwardMoyse
Copy link
Author

Thanks - my apologies for not responding, but I tried updating moduleResolution and opened a massive, massive can of worms. My plan was to come back here once I had news, but I'm still struggling. Anyway, thank you very much for your help.

@EdwardMoyse
Copy link
Author

All good now! Thanks again.

0b5vr added a commit to 0b5vr/three-vrm-inspector that referenced this issue Oct 22, 2024
new Three.js types need tsconfig module resolution to be `Bundler`
three-types/three-ts-types#1136

Bump `typescript`, `@types/node`, and `@types/codemirror` to latest

This also requires us to put `.js` at the end of Three.js addon imports

ACESFilmicToneMappingShader type patch is no longer required

I really need to bump these stale deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants