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

Can't run on react-addons-test-utils@15.4.0-rc.3 #56

Closed
wellyshen opened this issue Nov 5, 2016 · 16 comments
Closed

Can't run on react-addons-test-utils@15.4.0-rc.3 #56

wellyshen opened this issue Nov 5, 2016 · 16 comments

Comments

@wellyshen
Copy link

wellyshen commented Nov 5, 2016

Hi I update my react-addons-test-utils to 15.4.0-rc.3, that the error occurs when I run npm test.

ERROR in .//react-element-to-jsx-string//react-addons-test-utils/index.js
Module not found: Error: Can't resolve 'react/lib/ReactTestUtils' in '/Users/Welly/Desktop/react-cool-starter/node_modules/react-element-to-jsx-string/node_modules/react-addons-test-utils'
@ .//react-element-to-jsx-string//react-addons-test-utils/index.js 1:17-52
@ .//react-element-to-jsx-string/index-dist.js
@ .//chai-enzyme/build/assertions/contain.js
@ ./~/chai-enzyme/build/index.js
@ ./tools/testing/test-bundler.js

Any solution for this?

@vvo
Copy link
Contributor

vvo commented Nov 7, 2016

I guess they moved some files away to another package maybe? Have a look at react release notes or wait for an official release. Then we will have to update the files somehow

@vvo
Copy link
Contributor

vvo commented Nov 14, 2016

Once this is out and not in RC we can upgrade the library, no idea how untill we get a proper changelog

@armandabric
Copy link
Collaborator

React 15.4 is out https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html

The issue is still present with this last version of react and the last version of the lib (v5.0.0):

Cannot find module 'react/lib/ReactTestUtils' from 'index.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:151:17)
      at Object.<anonymous> (node_modules/react-addons-test-utils/index.js:1:107)
      at Object.<anonymous> (node_modules/react-element-to-jsx-string/index-dist.js:23:29)

@ayrton
Copy link

ayrton commented Nov 16, 2016

I think this is what happened:

However, there is a possibility that you imported private APIs from react/lib/*, or that a package you rely on might use them. We would like to remind you that this was never supported, and that your apps should not rely on internal APIs. The React internals will keep changing as we work to make React better.

Suggestion as to how to deal with this from one of the react people: https://twitter.com/dan_abramov/status/798951400654913536

@vvo
Copy link
Contributor

vvo commented Nov 16, 2016

Nowhere in the code we try to access "react/lib/ReactTestUtils" so there's something else going on here.

@vvo
Copy link
Contributor

vvo commented Nov 16, 2016

@vvo
Copy link
Contributor

vvo commented Nov 16, 2016

Here's the issue: facebook/react#8314

@vvo
Copy link
Contributor

vvo commented Nov 16, 2016

I wonder if react-dom should be a direct dependency instead, what do you think?

@vvo vvo closed this as completed in 06d2588 Nov 16, 2016
@vvo
Copy link
Contributor

vvo commented Nov 16, 2016

should be fixed in 5.0.1, let me know

@gaearon
Copy link

gaearon commented Nov 17, 2016

For future reference please report issues in RCs to us :-). This is the reason we publish them.

@vvo
Copy link
Contributor

vvo commented Nov 17, 2016

@gaearon What happened here is that given the error message we got ("Can't resolve 'react/lib/ReactTestUtils'") I thought that it was only a matter of updating some /path/ in the code once the release would be out. While the root issue was that react-addons-test-utils was no more working.

I understand your point about testing RCs but this open source project is part of what we do at Algolia and has lower priority than our core business. That's why we did not investigate a lot and missed an opportunity to raise a breaking change in react-addons-test-utils.

@vvo
Copy link
Contributor

vvo commented Nov 17, 2016

@Spy-Seth I saw you 👎 my comment Once this is out and not in RC we can upgrade the library, no idea how untill we get a proper changelog. I can understand your frustration but please understand this is an open source library and in such anyone can contribute to it. From opening issues to fixing a bug.

It took 10 minutes to figure out the root cause so I would recommend anyone opening issues on any open source project to also have a quick look if they can actually fix the issue or dig a bit more into it and find the root cause. The code of react-element-to-jsx-string is no magic. We are not code wizs, it's simple parsing and using a dependency from react-addons-test-utils. Contribute!

4 people including me participated in this issue and no one took the necessary 10 minutes to run the code and dig it. We are the authors but it does not imply we will fix every bug or add every feature for you, you have to participate.

@armandabric
Copy link
Collaborator

armandabric commented Nov 17, 2016

@vvo I'm sorry if I've hurt you with my 👎 I will try to explain me.

We all do open source here, we know the rule: help and be helped. And like you said, we all have a limited time: you have limited time to maintain the library, I have limited time to debug library that I use.

I put the 👎 because I think it's not a good message spread. As a library author we have to follow our dependencies and check the incompatibilities against RC. And again, this is the perfect state of the art. I was not judging the fact you do not do it, I judge the message.

And by the way, your library helps us a lot 👍 thanks you for that.

@armandabric
Copy link
Collaborator

And by the way the fix works :)

@ericmasiello
Copy link

I'm seeing this same issue. I'm currently using React and React DOM 15.4.2.

This is producing the following error when I attempt to bundle my code:

ERROR in ./~/react-element-to-jsx-string/index-dist.js
Module not found: Error: Can't resolve 'react-dom/test-utils' in '/Users/eric/Sites/stencil/node_modules/react-element-to-jsx-string'

@gaearon
Copy link

gaearon commented Jun 7, 2017

I'm seeing this same issue.

This is not the same issue (notice the module name is different from the one in the thread).
Please update to React 15.5.4, and it will be fixed.

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

6 participants