KyleAMathews / react-spinkit

A collection of loading indicators animated with CSS for React
http://kyleamathews.github.io/react-spinkit/
MIT License
1.49k stars 73 forks source link

Error: Can't resolve 'react/lib/Object.assign' with React 15.0 #28

Closed nil4 closed 8 years ago

nil4 commented 8 years ago

Using react-spinkit version 1.1.4 with React 15.0 results in the following error:

ModuleNotFoundError: Module not found: Error: Can't resolve 'react/lib/Object.assign' in 'C:\projects\MyProject\node_modules\react-spinkit\dist'

KyleAMathews commented 8 years ago

So that require wasn't even being used. Removed it and published 1.1.5. https://github.com/KyleAMathews/react-spinkit/commit/1404b2702e61ad2416a95afacefe20732628b60b

nil4 commented 8 years ago

@KyleAMathews awesome, thank you for the fantastic turn-around time!

nil4 commented 8 years ago

@KyleAMathews I upgraded to 1.1.5 but still fails; dist/index.js still has the line:

objectAssign = require('react/lib/Object.assign');
KyleAMathews commented 8 years ago

Ooops! Forgot to compile the src. I re-published 1.1.6.

nil4 commented 8 years ago

@KyleAMathews thanks a lot! Unfortunately there's another issue: React.__spread has been removed in v15.0, and the <div {... @props} syntax seems to compile down to it.

KyleAMathews commented 8 years ago

Ha :-) would you mind taking a crack at solving this? On Thu, Apr 7, 2016 at 4:12 PM nil4 notifications@github.com wrote:

@KyleAMathews https://github.com/KyleAMathews thanks a lot! Unfortunately there's another issue: React.__spread has been removed https://github.com/facebook/react/pull/6431 in v15.0, and the <div {... @props} syntax seems to compile down to it.

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/KyleAMathews/react-spinkit/issues/28#issuecomment-207133646

KyleAMathews commented 8 years ago

https://github.com/facebook/react/pull/6444

nil4 commented 8 years ago

Tracked it down to cjsx-loader, specifically this: https://github.com/jsdf/coffee-react-transform/pull/32. I'll open an issue on there. For now, I can unblock myself by using just the CSS styles; it would be a shame though, since react-spinkit is such a nice library -- thank you again.

KyleAMathews commented 8 years ago

If you see the above PR, they're adding it back in.

zpao commented 8 years ago

You should still stop using it :)

KyleAMathews commented 8 years ago

This was written back in my hellion Coffeescript days ;-)

nil4 commented 8 years ago

I opened https://github.com/jsdf/coffee-react-transform/issues/70 while waiting for React 15.0.1 :smile:.

KyleAMathews commented 8 years ago

15.0.1 was released.

nil4 commented 8 years ago

@KyleAMathews: jsdf/coffee-react-transform#70 was fixed, removing the use of React.__spread. Would you consider upgrading to version 4.0 to fix this one for good?

KyleAMathews commented 8 years ago

Updated and released 1.1.7.