-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Production build is broken for node-haste since 15.4 #8442
Comments
The providesModule system was never a supported way to consume React modules. The recommended way is to Is there an issue with using jest in react-native that is depending on |
I personally don't use mixedcase commonjs ... only lowercase (I hase case-sensitive FS). React-native project builds successfully, so may be it's a bug somewhere in jest internally |
cc @yungsters |
cc @cpojer |
@sebmarkbage I don't think what you are saying is true. We used haste modules from React's (and previously also fbjs) npm package in react-native-packager which is why Jest is whitelisting the package with the jest-react-native preset as well. I'm just getting back from a trip so I'm a bit unsure what happened recently but it seems to me like react-native needs to have a |
It does: facebook/react-native@b06b7ae @ColCh does [email protected] help at all? just curious. |
That's odd, in that case Jest definitely knows about that React module proxy. When using |
Hmm, actually when we updated react-native to 15.4 we had this issue and we added an entry to the We haven't forwarded jest-react-native to react-native yet, unfortunately. cc @kentaromiura |
@sebmarkbage simple grep shows that there is node-haste comment And, at same time:
In that file
@cpojer it seems that this simple change diff --git a/package.json b/package.json
index 173950e..770acde 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"jest": {
- "preset": "jest-react-native",
+ "preset": "react-native",
"collectCoverageFrom": [
"scripts/*.js",
"src/**/*.js", resolved Hm... it seems it finally started to work nicely 👍 there are some diffs in snapshots, but I can handle it. Thanks! |
I'll update jest-react-native today to forward to react-native. I'm also updating Jest's documentation to hint that you won't need See #2182. |
This issue is tighly coupled with issue from jest: jestjs/jest#1840
My comment for explanation, why it's related to React: jestjs/jest#1840 (comment) . I will dupe some info in current issue.
As
15.4.0-rc.2
->15.4.0-rc.3
version update,@providesModule React
is dissapeared from production code. Under "production" I mean that code which ships with npm. And, jest tests became broken. And no way to fix it, because of version tags. Latest version with@providesModule
is15.4.0-rc.2
, and it just can't be used as a workaround:Git tags compare ( v15.3.2...v15.4.0-rc.3 ) shows an interesting commit, 2d049e8
As we can see, that commit comes from this Pull Request: #7968
The text was updated successfully, but these errors were encountered: