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

useAnimations is broken #263

Closed
tiborsaas opened this issue Jan 27, 2021 · 3 comments
Closed

useAnimations is broken #263

tiborsaas opened this issue Jan 27, 2021 · 3 comments

Comments

@tiborsaas
Copy link

tiborsaas commented Jan 27, 2021

  • three version: 0.125.1
  • react-three-fiber version: 5.3.18
  • @react-three/drei version:2.2.2

Problem description:

useAnimations throws an error.

Error output:

C:\dev\private-projects\dead-off\node_modules\@react-three\drei\useSubdivision.js:3:36: Cannot resolve dependency 'three/examples/jsm/modifiers/SubdivisionModifier'
  1 | import { useRef, useEffect } from 'react';
  2 | import { Geometry, BufferGeometry } from 'three';
> 3 | import { SubdivisionModifier } from 'three/examples/jsm/modifiers/SubdivisionModifier';
    |                                    ^
  4 | 
  5 | function useSubdivision(subdivisions) {
  6 |   const ref = useRef();

According to the Three.js changelog, the SubdivisionModifier is indeed removed:

https://github.com/mrdoob/three.js/releases/tag/r125

Suggested solution:

The linked issue has some good ideas: mrdoob/three.js#21072

@tiborsaas tiborsaas added the bug Something isn't working label Jan 27, 2021
@joshuaellis joshuaellis added invalid and removed bug Something isn't working labels Jan 27, 2021
@joshuaellis
Copy link
Member

joshuaellis commented Jan 27, 2021

@react-three/drei does not currently support three r125. We support up to 0.124.x. It only came out today with a lot of breaking changes, we are currently working on it.

@tiborsaas
Copy link
Author

Makes sense. Maybe it would worth mentioning it in the readme.

@joshuaellis
Copy link
Member

I do believe its in the package peer deps of the latest release, even if you were using r124, it would not work with drei 1.2.2 because CurveModifier was introduced in r122. So in short, i'd update to the latest version of @react-three/drei and keep at three 124.

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