Status-react: Fix yarn warnings

Created on 4 Dec 2018  ·  29Comments  ·  Source: status-im/status-react

User Story

As a developer, I want to be able to build without warnings.

Description

Right now yarn install produces a lot of warnings about some dependencies being unmet, etc. We would like to fix them.

Expected behavior

yarn install on node 10 works w/o warnings.

bounty-m

All 29 comments

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


__This issue now has a funding of 200.0 DAI (200.0 USD @ $1.0/DAI) attached to it as part of the Status-im fund.__

Issue Status: 1. Open 2. Cancelled


__Work has been started__.

These users each claimed they can complete the work by 9 months, 2 weeks from now.
Please review their action plans below:

1) ej-sanmartin has applied to start work _(Funders only: approve worker | reject worker)_.

Hello,

I am planning to yarn install to see what errors are exactly occurring and clearing them up from there. You mentioned it worked on Node 10 fine, but what version of Node are you wanting this to work on?

Learn more on the Gitcoin Issue Details page.

2) nofwayy has been approved to start work.

You can find my analysis and proposal here https://github.com/status-im/status-react/issues/6996#issuecomment-458705166

Learn more on the Gitcoin Issue Details page.

@mandrigin Hello, I have just git cloned the repo and yarn installed with no warnings at all.

My environment:
MacOS (Mojave v10.14)
yarn (v1.13.0)
node (v11.8.0)
npm (6.5.0)

What is your environment or the environment you are trying to develop in? I can try to replicate your environment or perhaps you can use mine. Let me know soon!

status-react_yarn_install_result

@mandrigin Also, I have used nvm to change my node version to 10.0.0 as you put on your "expected behavior" in the bounty description. Also, note that it changed npm to v5.6.0. Yarn install still yields no warnings.

status-react_npm_10 0 0_result

@ej-sanmartin thanks a lot for your time!

What I get on macOS Mojave on current develop branch is:

yarn install v1.13.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react-native@>= 0.57.0-rc.3".
warning " > [email protected]" has unmet peer dependency "fbjs@*".
warning " > [email protected]" has incorrect peer dependency "react-native@^0.51.0".
warning "rn-snoopy > [email protected]" has unmet peer dependency "eslint@^2.10.2 || ^3 || ^4".
[4/4] 🔨  Building fresh packages...
✨  Done in 11.95s.

I don't know why these issues aren't reproducible in your case... my node -version is v10.14.1

@mandrigin hey, I'll try again soon with node v10.14.1.

Something to note, react native isn't even in v1.0.0 yet so it's naturally always updating. This often leads to dependencies being deprecated or not working like it use to, it's a race of keeping up hahaha. I'll try to replicate your error message but I have a hunch that it has something to do with the nature of react native specifically. Maybe try yarn upgrade

@mandrigin hello I tried again with your node version.

status-react_node_10 14 1

Let me know any other information that would be relevant to replicating your case. Perhaps try to git clone the current repo on guthub, yarn upgrade (so all packages are up to date), and then yarn install.

@ej-sanmartin we specifically don't use yarn update, we upgrade dependencies only after looking at them from the security perspective. So, you think it is some outdated dependency that does it? If your yarn.lock file differs, please submit a PR with updates so we can review and approve it.

@mandrigin I'm actually able to reproduce your warnings.

Running on Mojave, reproduced with nodeJS version 10.12.0 and 10.15.0
Here is my output :

yarn install
yarn install v1.13.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react-native@>= 0.57.0-rc.3".
warning " > [email protected]" has unmet peer dependency "fbjs@*".
warning " > [email protected]" has incorrect peer dependency "react-native@^0.51.0".
warning "rn-snoopy > [email protected]" has unmet peer dependency "eslint@^2.10.2 || ^3 || ^4".
[4/4] 🔨  Building fresh packages...
✨  Done in 16.83s.

@ej-sanmartin if you look at your node_modules after running yarn install, I'm guessing this will be empty... therefore the fact that you have no warnings.

@mandrigin that makes sense, considering the nature of your product. However, there's a chance that the updates for some of these dependencies do include patches for these errors which could help your issue. I'd suggest making a branch and first upgrading all the dependencies. Check to see if any security issues arise and if not maybe consult your team that this update, in this case, won't be breaking or cause for any concern.

One more thing, I read from https://stackoverflow.com/questions/44837765/react-native-peer-dependency-issue-in-expo that you may have to use [email protected] instead of [email protected] for the warnings to go away. Just a heads up.

My yarn.lock file has no differences and I didn't make any changes to any other files. Do you still want me to make a PR with what we discuss on how to fix this issue in that PR's description?

@nofwayy yes, it is empty besides a .yarn-integrity file. I deleted the node_modules folder, however, and still did not get the warning when running yarn install.

Stack Overflow
What is the best way to deal with solving a peer dependency issue in React Native when using Expo? I am stuck with a peer dependency error. I didn’t install any new packages to cause a new peer

Ok so here is a summary

  • react-native-firebase warning

You're using a fork of react-native-firebase which is requiring a peer dependency for react-native >= 0.57.0-rc.3. And, you are also using a fork of react-native with a version equal to 0.56.0.
At some point this was ok (commit 87cf8d900ce83e1a2a5903cf1a3359015600888b), but not after this commit : bc2db72ff50021e7704521722d899b9d2d8d96a8.

Solution : As this seems to work for you so far, a fix could be to change the peer-dependency in your react-native-firebase fork back to >= 0.56.0.

as of the fbjs@* warning for react-native-firebase peer dependency,
in later versions of the original react-native-firebase this has been removed.

Solution : You may just want to do the same. fbjs is a dependency of react-native (and others) anyway... so this is redundant. (Not sure why yarn is warning about that as this one is in your deps, could dig more)

  • [email protected]
    This one is set at react-native 0.51, you are using 2.56. version 2.11.16 of react-native-fs fixes that "react-native": ">=0.51.0 <1.0.0".

    solution : either you fork and fix current deps version or migrate to [email protected]

  • rn-snoopy > [email protected] warning
    This one (package eslint-plugin-jsx-a11y) explicitly require you to have eslint in your deps somewhere, which you don't (Could be a miss-use of peer-dependencies on their side).

    Solution: either you add eslint in your deps, or choose not to (and if you want this warning to go away, you will have to fork and remove the peer-dependency).

@mandrigin Let me know your thoughts on this analysis. Will be happy to do all the required changes all around (this needs a bunch of MR on multiple repositories you have - or not yet like in the last case).

@ej-sanmartin you are unable to reproduce that issue because you actually don't install anything here. You should run make setup first, or at least copy the relevant package.json yarn.lock from one of the following directories desktop_files or mobile_files.

@nofwayy thanks for the great overview!

react-native-firebase warning

We want to upgrade react-native to 0.58 and get rid of our own fork of it. All the issues we had are fixed upstream. PRs appreciated, but keep in mind that that requires at least some sanity testing the app.

[email protected]

Again, let's try to upgrade this dependency as a separate PR so we can review and test that it works.

Tell me if you are interested in proceeding!

@mandrigin You're welcome. Definitely interested ! Waiting for your Gitcoin approval for this job then.
Also, it seems to me those changes would feet in other issues.

@nofwayy you've been approved to start work on this one.

@nofwayy Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

still working on it

@nofwayy Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@nofwayy Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@nofwayy due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@nofwayy due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] reminder (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

Testing and various platforms is time consuming. Still working on it

@nofwayy have snoozed warnings thanks for the update! Let us know of any progress made.

@nofwayy Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@nofwayy Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@nofwayy any update on this one?

@nofwayy pinging again.

@mandrigin do you have any insight here?

@StatusSceptre I think it isn't valid anymore after switching to nix.

Issue Status: 1. Open 2. Cancelled


__The funding of 200.0 DAI (200.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter__

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andmironov picture andmironov  ·  73Comments

jakubgs picture jakubgs  ·  54Comments

rachelhamlin picture rachelhamlin  ·  49Comments

yenda picture yenda  ·  52Comments

jakubgs picture jakubgs  ·  44Comments