pmndrs / react-spring

✌️ A spring physics based React animation library
http://www.react-spring.dev/
MIT License
27.73k stars 1.18k forks source link

[bug]: core imports not found with pnpm #2278

Open TobiTRy opened 1 month ago

TobiTRy commented 1 month ago

Which react-spring target are you using?

What version of react-spring are you using?

9.7.3

What's Wrong?

I'm encountering an issue where useTransition and potentially other imports from @react-spring/web are not found when the package is installed using pnpm.

The error message is: image

This seems to extend to other packages that rely on @react-spring/core.

However, installing @react-spring/core explicitly as a workaround does resolve the import issue. This leads me to believe the problem lies with pnpm's handling of transitive dependencies.

Implications:

After installing @react-spring/core, I now encounter TypeScript errors.

image

To Reproduce

pnpm install @react-spring/web

Attempt to import and use useTransition in a component:

import { useTransition } from '@react-spring/web';

Expected Behaviour

useTransition and other core components should be importable from @react-spring/web the package is installed with pnpm

Link to repo

https://github.com/TobiTRy/FUI-FancyUI