pmndrs / react-spring

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

[bug]: react-spring Identifier 'React' has already been declared #2231

Closed m-alfred closed 9 months ago

m-alfred commented 9 months ago

Which react-spring target are you using?

What version of react-spring are you using?

9.7.3

What's Wrong?

when i run webpack build it's ok。 but when i run webpack dev server, appear this error: react-spring Identifier 'React' has already been declared。but run 。

` ERROR in ./node_modules/@react-spring/animated/dist/react-spring_animated.modern.mjs 381:7 Module parse failed: Identifier 'React' has already been declared (381:7) File was processed with these loaders:

To Reproduce

run webpack dev-server

Expected Behaviour

no error appear

Link to repo

none

joshuaellis commented 9 months ago

can you share a repo? I've used webpack on many projects with react-spring and not ran into any issues.

m-alfred commented 9 months ago

It's my babel config cause the error 。 I've fixed by removing the babel plugin: babel-plugin-typescript-to-proptypes。

joshuaellis commented 9 months ago

Then it sounds like there's nothing we can do because it's your project 😊