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

fix(types): shaderIntersectFunction is defined by three-mesh-bvh #2089

Merged

Conversation

Methuselah96
Copy link
Contributor

@Methuselah96 Methuselah96 commented Sep 9, 2024

Why

There are currently type errors when using drei with three-mesh-bvh@^0.7.7, since they added the shaderIntersectFunction type definition in gkjohnson/three-mesh-bvh#697:

./node_modules/@react-three/drei/materials/MeshRefractionMaterial.d.ts(3,11): error TS2451: Cannot redeclare block-scoped variable 'shaderIntersectFunction'.
./node_modules/three-mesh-bvh/src/index.d.ts(318,14): error TS2451: Cannot redeclare block-scoped variable 'shaderIntersectFunction'.

What

Update three-mesh-bvh and remove module augmentation

Checklist

  • Ready to be merged

Copy link

vercel bot commented Sep 9, 2024

@Methuselah96 is attempting to deploy a commit to the Poimandres Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codesandbox-ci bot commented Sep 9, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@Methuselah96
Copy link
Contributor Author

Methuselah96 commented Sep 9, 2024

Hmm, seems like three-mesh-bvh@0.7.7 also imports BatchedMesh which is not available in all versions of three that drei supports. I guess the three-mesh-bvh could be pinned back to three-mesh-bvh@0.7.6, but seems like you'll want to be able to upgrade at some point... This has been fixed in three-mesh-bvh@0.7.8

@Methuselah96
Copy link
Contributor Author

Methuselah96 commented Sep 16, 2024

The issue with importing BatchedMesh was fixed in three-mesh-bvh@0.7.8, this PR should be ready to merge now

@CodyJasonBennett CodyJasonBennett merged commit d6383e1 into pmndrs:master Sep 22, 2024
3 of 4 checks passed
Copy link

🎉 This PR is included in version 9.113.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Typescript compilation failure with @react-three/drei@9.112.0 and three-mesh-bvh@0.7.8
2 participants