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

Broken using React 0.14 and NPM 2 #24

Closed
pcwinters opened this issue Apr 15, 2016 · 5 comments
Closed

Broken using React 0.14 and NPM 2 #24

pcwinters opened this issue Apr 15, 2016 · 5 comments

Comments

@pcwinters
Copy link

react-element-to-jsx-string lists React 0.15 as a dependency, which npm 2 will complain about if an application uses React 0.14.

FYI, I was pulling "jsx-chai": "^2.0.0" which in turn pulls react-element-to-jsx-string. npm 2 installs React 0.15 for you and then errors on invalid peer dependencies, because everything else in the application expects 0.14.

@vvo vvo closed this as completed in 7347b71 Apr 15, 2016
@vvo
Copy link
Contributor

vvo commented Apr 15, 2016

should be fixed now, let me know

@pcwinters
Copy link
Author

fixed. ty 👍

@mgibeau
Copy link

mgibeau commented Apr 27, 2016

Sorry to resurrect this but, I'm having the same issue while using chai-jsx. Using npm 3 grabs react-addons-test-utils@15.0.1

Not sure if || is a correct expectation for a dependency
7347b71#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R36

@vvo
Copy link
Contributor

vvo commented Apr 28, 2016

Can you create a testing repo that is reproducing this so we can fix it? Or do you have a fix in mind?

@mgibeau
Copy link

mgibeau commented Apr 28, 2016

https://github.com/mgibeau/react-element-to-jsx-string_issue_24_sample

As for a fix, it seems there are no clear cut solutions in this particular case. I think the most straight forward is to simply release separate versions that target different react versions (e.g.: 2.0 -> 0.14 vs 3.0 -> 15).

Moving react-addons-test-utils to a peer dependency would work too, but would kinda break backward compatibility.

Otherwise, I guess a postinstall script that figures out the react version and conditionally install the react-addons-test-utils is also possible, but this seems a bit overkill.

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

3 participants