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

Vendor Types For XRFrame Resolving Incorrectly #3110

Closed
mbostwick opened this issue Dec 3, 2023 · 2 comments · Fixed by #3111
Closed

Vendor Types For XRFrame Resolving Incorrectly #3110

mbostwick opened this issue Dec 3, 2023 · 2 comments · Fixed by #3111
Labels
bug Something isn't working Typescript issues to do with TS

Comments

@mbostwick
Copy link

mbostwick commented Dec 3, 2023

The below was a work around to get around types, but the outputs do not work with the latest distributed versions:
#2501

Versions:

  • three: 0.159.0
  • @types/three: 0.159.0
  • three-stdlib: 2.28.7
  • @react-three/fiber: 8.15.11

Related Code

https://github.com/pmndrs/react-three-fiber/blob/master/packages/fiber/src/core/utils.ts

Related Error

  • node_modules/@react-three/fiber/dist/declarations/src/core/index.d.ts:14
  • node_modules/@react-three/fiber/dist/declarations/src/core/loop.d.ts:32
  • node_modules/@react-three/fiber/dist/declarations/src/core/store.d.ts:136
  • node_modules/@react-three/fiber/dist/declarations/src/core/utils.d.ts:6
 error TS2694: Namespace '"C:/project/src/web/node_modules/@types/three/index"' has no exported member 'XRFrame'.

14 declare const invalidate: (state?: RootState | undefined, frames?: number) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void;
                                                                                                                                                                                             ~~~~~~~

node_modules/@react-three/fiber/dist/declarations/src/core/loop.d.ts:32:117 - error TS2694: Namespace '""C:/project/src/web/node_modules/@types/three/index"' has no exported member 'XRFrame'.    

32     advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: import("three").XRFrame | undefined) => void;
                                                                                                                       ~~~~~~~

node_modules/@react-three/fiber/dist/declarations/src/core/store.d.ts:136:225 - error TS2694: Namespace '""C:/project/src/web/node_modules/@types/three/index"' has no exported member 'XRFrame'.  

136 declare const createStore: (invalidate: (state?: RootState | undefined, frames?: number | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean | undefined, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void) => UseBoundStore<RootState>;
                                                                                                                                                                                                                                    
~~~~~~~

node_modules/@react-three/fiber/dist/declarations/src/core/utils.d.ts:6:41 - error TS2694: Namespace '""C:/project/src/web/node_modules/@types/three/index"' has no exported member 'XRFrame'.     

6 declare type _DeprecatedXRFrame = THREE.XRFrame;

Possible Solution

Remove type _DeprecatedXRFrame = THREE.XRFrame, and move to the XRFrame as part of https://www.npmjs.com/package/@types/webxr

@CodyJasonBennett
Copy link
Member

Released a fix in v8.15.12. In the future, you can enable skipLibCheck if you must sidestep transient types issues.

@mbostwick
Copy link
Author

I had to enable LibCheck because I was getting pmndrs/drei#1732, but needed to trace it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Typescript issues to do with TS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants