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

[Urgent] Doesn't support the latest builds of React-Native and React #1083

Closed
vadiminc opened this issue Jun 10, 2017 · 12 comments
Closed

[Urgent] Doesn't support the latest builds of React-Native and React #1083

vadiminc opened this issue Jun 10, 2017 · 12 comments

Comments

@vadiminc
Copy link

vadiminc commented Jun 10, 2017

yarn add react-native

warning "react-native@0.45.1" has incorrect peer dependency "react@16.0.0-alpha.12".

after that
yarn add react@16.0.0-alpha.12

warning "enzyme@2.8.2" has incorrect peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x".
warning "react-dom@15.5.4" has incorrect peer dependency "react@^15.5.4".
warning "react-test-renderer@15.4.2" has incorrect peer dependency "react@^15.4.2".
warning "reactotron-react-native@1.11.1" has incorrect peer dependency "react@>=15.2.1".

lets say we can ignore and do not use enzyme, react-test-renderer, reactotron-react-native but react-dom is important.

Steps to reproduce it:

ignite new v3 
cd v3
yarn add react-native
yarn add react@16.0.0-alpha.12
react-native run-android 
@skellock
Copy link
Contributor

The https://github.com/infinitered/ignite-ir-boilerplate boilerplate has been updated to 0.45.1. Just waiting a release.

You can also control the version of react native by ignite new MyApp --react-native-version 0.45.1.

@edolix
Copy link

edolix commented Jul 10, 2017

Hi @skellock, i have a related issue with Ignite v2.0.0.
I just created a new project with ir-boilerplate and have dependencies warnings.

Command: ignite new TestApp --min

Warning from npm cli:

npm ERR! peer dep missing: react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x, required by enzyme@2.9.1
npm ERR! peer dep missing: react@^15.4.2, required by react-dom@15.4.2
npm ERR! peer dep missing: react@>=15.2.1 || 16.0.0-alpha-6 || 16.0.0-alpha-12, required by reactotron-react-native@1.12.0

npm test results in 5 failed and 3 passed tests for react-dom dependencies (I think)

Here is my ignite doctor log:

System
  platform           darwin
  arch               x64
  cpu                2 cores                              Intel(R) Core(TM)2 Duo CPU     P7550  @ 2.26GHz
  directory          /Users/edolix/Dev/tests/v2/TestApp

JavaScript
  node               8.1.3        /usr/local/bin/node
  npm                5.0.3        /usr/local/bin/npm
  yarn               0.27.5       /usr/local/bin/yarn

React Native
  react-native-cli   2.0.1
  app rn version     0.45.1

Ignite
  ignite             2.0.0        /usr/local/bin/ignite

Android
  java               1.8.0_131    /usr/bin/java
  android home       -            /usr/local/share/android-sdk

iOS
  xcode              8.3.3

Am I doing something wrong?

Thanks

@aschrijver
Copy link
Contributor

@edolix I can confirm this on a similar issue. On a new ignite 2.0.0 project I get following on first install:

npm WARN enzyme@2.9.1 requires a peer of react@0.13.x || 0.14.x || ^15.0.0-0 || 15.x but none was installed.
npm WARN reactotron-react-native@1.12.0 requires a peer of react@>=15.2.1 || 16.0.0-alpha-6 || 16.0.0-alpha-12 but none was installed.
npm WARN react-dom@15.4.2 requires a peer of react@^15.4.2 but none was installed.
  • node: 8.1.2
  • npm: 4.6.1
  • yarn: 0.24.6
  • rn: 0.45.1
  • Ubuntu 16.04

@aschrijver
Copy link
Contributor

Apparently the solution is to either downgrade react, or wait for RN 0.16 to become stable, as enzyme does not support alpha releases:

enzymejs/enzyme#928

@edolix
Copy link

edolix commented Jul 11, 2017

@aschrijver I have downgraded React but the results are a lot of other dependencies error/warning. You have to downgrade almost "all" libraries

@aschrijver
Copy link
Contributor

aschrijver commented Jul 11, 2017

Yes, I am also in the process of downgrading. Not happy about it. Getting all kinds of issues.

BTW react-native is not going to change relying on alpha's. Here's their explanation: enzymejs/enzyme#893 (comment)

@aschrijver
Copy link
Contributor

@skellock Please reopen as the issue is still at play.

@aschrijver
Copy link
Contributor

aschrijver commented Jul 12, 2017

@edolix I found the issue with the tests. I had to add -u --no-cache to package.json:

"test": "NODE_ENV=test jest -u --no-cache"

Found it out by accident, while sorting out the nightmare of getting VS Code to hit my breakpoints while debugging. Still working on it..

[UPDATE: Not sure on this anymore. Encountered millions of errors, red screens and other horrors setting up the stack. Terrible dev experience. Can now finally do some work after downgrading Node from v8 to v7 (see: stackoverflow question).]

@skellock
Copy link
Contributor

There’s a lot of drift in this issue. For that reason I’m going to keep this closed.

Let me address what are legit issues tho.

So ya, enzyme is not working with the latest React Native. It is currently being rewritten and will be available soon though. This is frustrating to me because we were happy with how our testing was going, and now we can’t use it short term. 🙁

The warnings you see when installing are because the peer dependencies of those libs don’t match. In the case of reactotron-react-native, I typed the dependency version wrong (-16 vs .16). I will fix that once I get out of bed here. ☺️ (harmless warning btw)

As far as red screens are concerned, I’d need to see the specific traces to help. One thing that snags me often when switching React Native versions is caches. watchman watch-del-all can help. rm -rf node_modules helps as well.

With VS Code debugging in Node 8, yes that’s a problem. Both the node and code teams are awesome and we should see a fix soon.

Addressing the horrible dev experience when all this happens, yes. It sucks. We (as a community) can do better. One of my favourite talks at Chain React a few days ago was by Brent Vatne pointing this out. That we need to do better. React Native can be frustrating to deal with fragile deps. Even the panel talk pointed this out.

Good news is: we (the community at large) care.

Speaking more to Ignite though. When we get foot swept by our dependencies, we need to get back up faster. We can improve here for sure.

The enzyme breakage was particularly painful.

@aschrijver
Copy link
Contributor

Thanks for your help and background info!

I understand your frustrations all too well, and I'll also try to contribute to the community by linking issues, answering (my own and others) stackoverflow questions, etc.

For myself I've been busy about a week now trying to set things up, and no productive line of code written yet. Now looking into debugging setup (2 days, and counting).
I thought downgrading node to 7.10.1 and using VS Code fixed things for me, but it runs directly from disk, not the js bundle, so my node shims are all ignored. This is vscode-specific :(

About adding the --no-cache to jest task in package.json. This does seem to work getting rid of the 'Unexpected token import' errors, at least when I run tests in VS Code.

@edolix
Copy link

edolix commented Jul 13, 2017

@skellock Thanks for the support and info and thanks @aschrijver too!

@hhsadiq
Copy link

hhsadiq commented Aug 9, 2017

Having the same issue. Installed ignite yesterday.
image

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

5 participants