-
Notifications
You must be signed in to change notification settings - Fork 24.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
react-native init generate broken application (dependencies) #22606
Comments
@vovkasm Which package.json did you add it to? I'm trying to solve something similar. Do you mean react-native's package.json or your projects? |
@suark I have only one package.json file in the root of application folder. That file was initially generated by |
in the root directory of your react-native project. |
Weirdly enough, I updated my project from react-native 0.55.4 to 0.57.7 and the error was not occuring.
|
Thanks very much. Currently working for me. We are using react-native 0.57.5 right now. This fix, or "hack", has worked for us. I don't like not understanding it, but it works... |
It may have been introduced back in facebook/metro@039dedb. cc @rafeca |
Same issue for me, and the workaround worked. |
So, yeah, it's caused by 0.48.3 - I talked with @rafeca a while back and we agreed that 0.48.3 was going to be removed from npm to avoid this issue (basically, this release - as pointed out - requires the wrong version of jest haste map) but it seems that the Metro team never had time to do it 😕 A "cleaner" workaround for now would be to enforce using Metro 0.48.2 via yarn resolutions. (as an alternative, for 0.57.8, I could do a local commit to the branch to enforce the fixed 0.48.2 without the |
How to enforce using Metro 0.48.2 with npm? |
Ok so I managed to reach out to the Metro team, they just published 0.48.4, which has the same content as 0.48.2, so if you clean up your yarn.lock & node_modules and reinstall it should now install 0.48.4 and the issue reported should not be there anymore. (Thanks @rafeca!) |
@kelset Perfect! Thank you for fast reaction! Just run my test case:
Hmm... something still not good:
|
Yea unfortunately Moreover, tag |
|
Hey @vovkasm! I did the publish manually from a local repo, with the same contents of the version I've just pushed the branch to github: https://github.com/facebook/metro/tree/v0.48.x if the conflicting commit is facebook/metro@039dedb, then it means I'll need to publish another version based on Can you confirm that? |
AH yeah I was about to write the same, by looking at the release notes it seems that 0.48.2 was in fact the one upgrading the jest - I have misremembered 🤦♂️ Sorry everyone 🤦♂️ |
@rafeca , @kelset And that one tagged as v0.48.1 didn't: |
Ok, thanks! I'm gonna unpublish |
Ok, |
Thanks @rafeca, @kelset! I'm slightly modify test case (because Sample package lives in Libraries folder of react-native project and leads to another conflict in haste :-D )
Now it works as expected! Also I'm tested that application actually run in ios simulator. Should I close this issue by myself? |
ok awesome, yeah feel free to close :) |
Close, because issue was resolved by publishing |
Environment
Description
Fresh project is unusable with this error:
How to reproduce
Workaround
There is hack to fix this, is adding
"jest-haste-map": "23.6.0"
topackage.json
Before hack (output of
npm ls jest-haste-map
:After hack:
Other info
Potential duplicates: #21146
The text was updated successfully, but these errors were encountered: