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

bug in @react-spring #1311

Closed
elibenjii opened this issue Feb 24, 2023 · 17 comments · Fixed by pmndrs/react-spring#2101
Closed

bug in @react-spring #1311

elibenjii opened this issue Feb 24, 2023 · 17 comments · Fixed by pmndrs/react-spring#2101
Labels
bug Something isn't working

Comments

@elibenjii
Copy link

2 months ago the code was working on the last version, something broke.

Module not found: Error: Can't resolve '@react-spring/types/animated' in '.../node_modules/@react-spring/core/dist'
Did you mean 'animated.js'?
BREAKING CHANGE: The request '@react-spring/types/animated' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@react-spring/core/dist/index.mjs 1597:0-50

Module not found: Error: Can't resolve '@react-spring/types/interpolation' in '.../node_modules/@react-spring/core/dist'
Did you mean 'interpolation.js'?
BREAKING CHANGE: The request '@react-spring/types/interpolation' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

@elibenjii elibenjii added the bug Something isn't working label Feb 24, 2023
@lstribli
Copy link

Same here. Seems both of these files are empty- fixing the extensions does nothing.

@elibenjii
Copy link
Author

I think solution could be to downgrade "@react-spring/three": "^9.3.1" in path node_modules/@react-three/drei/package.json

@lstribli
Copy link

This worked for me. Thanks!

@twmmason
Copy link

What version are you downgrading to?

@guix77
Copy link

guix77 commented Feb 24, 2023

Which latest version of drei does not have this issue ?

@twmmason
Copy link

Installing these versions works for me:

"@react-spring/three": "^9.6.1",
"@react-three/drei": "^9.56.26",
"@react-three/fiber": "^8.11.5",

@elibenjii
Copy link
Author

elibenjii commented Feb 24, 2023

I cannot fix :( in every version drei reference the last version of @react-spring/types with "^xx.xx.x" instead a specific one

@magdazelena
Copy link

@zob360 I have been also struggling with this for last couple hours. What worked for me was installing following fixed versions in my own repo:
"@react-spring/core": "9.3.1",
"@react-spring/three": "9.3.1",
"@react-spring/types": "9.3.1",

which is annoying because I do not need them, but I plan on removing them once I stop needing the drei controls :)

@pearson-reese
Copy link

pearson-reese commented Feb 24, 2023

Installing these versions works for me:

"@react-spring/three": "^9.6.1", "@react-three/drei": "^9.56.26", "@react-three/fiber": "^8.11.5",

After uninstalling and reinstalling nearly every permutation this morning, this finally worked for us – thank you!

@dk4tz
Copy link

dk4tz commented Feb 24, 2023

Installing these versions works for me:

"@react-spring/three": "^9.6.1", "@react-three/drei": "^9.56.26", "@react-three/fiber": "^8.11.5",

we were able to get it working locally but ran into the same issue building in an AWS CodeBuild Linux container... we were able to resolve by changing the ^ to ~

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Feb 24, 2023

Looks like react-spring@9.7.0 breaks TS resolution since ESM expects fully specified paths. You can pin to "@react-spring/three": "~9.6.1" as mentioned above until we get this fixed upstream.

I've implemented this in v9.56.27 of Drei for now, so an upgrade and a clean install should fix any previously broken builds.

@joshuaellis
Copy link
Member

This issue should definitely be kept open – pinning the dep isn't ideal for the future :)

@joshuaellis
Copy link
Member

joshuaellis commented Feb 25, 2023

Hi there, for anyone tracking this issue see – pmndrs/react-spring#2097.

There's an experimental version out (if you're using the three package change web to three):

yarn add @react-spring/web@0.0.0-aefd1e584376be38b1f6ca1ca74e061c4ce9b9d8-20230225174818

@AmreshSinha
Copy link

I am facing this issue with: @react-spring/web package (version: 9.7.0)
Is there any older web package version for a temporary fix?

@joshuaellis
Copy link
Member

I am facing this issue with: @react-spring/web package (version: 9.7.0)

Is there any older web package version for a temporary fix?

Did you see my comment above yours? There's an experimental release which I believe solves the issue. You can use that if you'd prefer.

@elibenjii
Copy link
Author

elibenjii commented Feb 27, 2023

on my side @react-spring/web@0.0.0-aefd1e584376be38b1f6ca1ca74e061c4ce9b9d8-20230225174818 not working.

@react-spring/web@0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728 working same as @react-spring/web": "9.6.1". It works only locally, a message error that can be closed is shown.
But impossible to build.

package.json:

    "@react-spring/animated": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",
    "@react-spring/core": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",
    "@react-spring/shared": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",
    "@react-spring/three": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",
    "@react-spring/types": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",
    "@react-spring/web": "0.0.0-40ac9039be0c657954e31ea7588bee4abbf1df1f-20230227081728",

error msg during build:
Module not found: Error: Package path ./animated is not exported from package /vercel/path0/node_modules/@react-spring/types (see exports field in /vercel/path0/node_modules/@react-spring/types/package.json)

@joshuaellis
Copy link
Member

Id track and comment on the issue in react-spring, it's hard for me to keep track of two conversations to this magnitude.

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

Successfully merging a pull request may close this issue.

10 participants