Skip to content

Conversation

@mrdoob
Copy link
Contributor

@mrdoob mrdoob commented Nov 13, 2025

This PR updates the three.js dependency to 0.181.1

I asked Claude why that skipLibCheck boolean was added and it said this:

We added "skipLibCheck": true because when we upgraded Three.js to version 0.181.1, the TypeScript compilation was failing with this error:

node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts(14,21): error TS2304: Cannot find name 'XRWebGLDepthInformation'.

The newer version of @types/three (0.181.0) includes WebXR type definitions that reference WebXR-specific types like XRWebGLDepthInformation, but these WebXR types weren't available in the TypeScript environment because the project's tsconfig.json didn't include them. The skipLibCheck option tells TypeScript to skip type-checking of all declaration files (.d.ts files) in node_modules.

Which sound like fun TypeScript stuff I don't want to know about 😇

@gkjohnson
Copy link
Owner

gkjohnson commented Nov 13, 2025

Which sound like fun TypeScript stuff I don't want to know about 😇

Fixing this kind of thing correctly is the exact thing AI should be good for... 🤦 😅 Can you try adding the following to the typescript file under "compilerOptions", instead? See the three-mesh-bvh tsconfig file.

    "lib": [ "dom", "es2017" ],
    "module": "node20",

@mrdoob
Copy link
Contributor Author

mrdoob commented Nov 13, 2025

It actually tried to do something similar:

Screenshot 2025-11-13 at 17 43 53

@mrdoob
Copy link
Contributor Author

mrdoob commented Nov 13, 2025

Fixing this kind of thing correctly is the exact thing AI should be good for... 🤦 😅 Can you try adding the following to the typescript file under "compilerOptions", instead?

Done!

@mrdoob
Copy link
Contributor Author

mrdoob commented Nov 13, 2025

Oh, the Node.js CI is failing now.

Did you want me to keep "skipLibCheck": true?

@gkjohnson
Copy link
Owner

Did you want me to keep "skipLibCheck": true?

I'll take a look at this when I have time. SkipLibCheck seems to basically makes typechecking useless.

@mrdoob
Copy link
Contributor Author

mrdoob commented Nov 13, 2025

Fun stuff 😁

@gkjohnson
Copy link
Owner

@Methuselah96 any idea why we might be seeing this typescript error?

node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts:14:21 - error TS2304: Cannot find name 'XRWebGLDepthInformation'.

14     init(depthData: XRWebGLDepthInformation, renderState: XRRenderState): void;
                      ~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@types/three/src/renderers/webxr/WebXRDepthSensing.d.ts:14

@Methuselah96
Copy link

This can be fixed by updating @types/webxr in the package-lock.json (just delete the node_modules/@types/webxr entry in package-lock.json and run npm install). Ideally @types/three would set a minimum required version of @types/webxr, but I'm not sure if DefinitelyTyped allows that.

@gkjohnson
Copy link
Owner

Thanks - just fixed it. I agree it would be better if a minimum version could be set.

@Methuselah96
Copy link

👍 Looks like DefinitelyTyped allows it. 🎉 Will be enforced in the next version of @types/three by three-types/three-ts-types#1889.

@gkjohnson gkjohnson merged commit 7160c54 into gkjohnson:main Nov 14, 2025
4 checks passed
@mrdoob mrdoob deleted the three-181 branch November 14, 2025 00:39
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

Successfully merging this pull request may close these issues.

3 participants