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

Update package.json for React 18 #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timhc22
Copy link

@timhc22 timhc22 commented Nov 27, 2023

Had a few issues when trying to build, so this addition may not be as simple as updating the peerDeps

 code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: react-qr-reader@3.0.0-beta-1
npm ERR! Found: @typescript-eslint/eslint-plugin@4.33.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   dev @typescript-eslint/eslint-plugin@"^4.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"2.x" from eslint-config-react-app@5.2.1
npm ERR! node_modules/eslint-config-react-app
npm ERR!   dev eslint-config-react-app@"^5.2.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/me/.npm/_logs/2023-11-27T17_49_44_163Z-eresolve-report.txt

Had a few issues when trying to build, so this addition may not be as simple as updating the peerDeps

```
 code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: react-qr-reader@3.0.0-beta-1
npm ERR! Found: @typescript-eslint/eslint-plugin@4.33.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   dev @typescript-eslint/eslint-plugin@"^4.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"2.x" from eslint-config-react-app@5.2.1
npm ERR! node_modules/eslint-config-react-app
npm ERR!   dev eslint-config-react-app@"^5.2.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/me/.npm/_logs/2023-11-27T17_49_44_163Z-eresolve-report.txt
```
github-merge-queue bot pushed a commit to proofcarryingdata/zupass that referenced this pull request Mar 18, 2024
Closes https://linear.app/0xparc-pcd/issue/0XP-238
Closes https://linear.app/0xparc-pcd/issue/0XP-239

We have various warnings on `yarn install`, mostly relating to missing
or incorrect peer dependencies. Some of these were because of mismatches
between expected package versions and the installed versions, and were
solved by upgrading the dependant packages so that the dependencies
match their expected version ranges (mostly upgrading `eslint` to 8.x).

In addition, various `@opentelemetry` packages had mismatches in their
dependency versions, which has been solved by pinning to specific
compatible versions rather than allowing yarn to install newer but
potentially incompatible dependencies.

In other cases, it was necessary to install packages as
`devDependencies` so that the peer package would stop complaining about
a missing `peerDependency`. This is odd, as no functional issues seemed
to arise from this, but it seems like the correct thing to do is to
install the missing dependency.

As a result of upgrading `eslint`, the fact that `anon-message-client`
lacks an `eslintrc.js` or equivalent config file became a problem, as
`yarn lint` would hang while prompting the user to decide what to do
about this. So, I added a configuration file, which means that `yarn
lint` now actually runs for `anon-message-client`. This threw up some
simple linting issues (e.g. missing function return types) which I
fixed.

Finally, I took the opportunity to make the version number explicit on
the `@pcd/eslint-config-custom` and `@pcd/tsconfig` dependencies
throughout the codebase. Previously we were generally using `'*'` as the
version number, but this was flagged as an issue
[here](https://github.com/proofcarryingdata/zupass/pull/1564/files#r1524098374).

The result is that *most* of the warnings have gone away. The following
ones remain:

```
warning "workspace-aggregator-e02a239c-4952-405a-abbd-87259c138f94 > passport-client > react-qr-reader@3.0.0-beta-1" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-e02a239c-4952-405a-abbd-87259c138f94 > passport-client > react-qr-reader@3.0.0-beta-1" has incorrect peer dependency "react-dom@^16.8.0 || ^17.0.0".
```

The incorrect peer dependency for `react-qr-reader` comes from the fact
that `react-qr-reader` expects a maximum React version of `^17.0.0`, and
we are on `18.2.x`. There is an unmerged PR for this in the
`react-qr-reader` repo from November, which looks like it would resolve
the issue if merged:
JodusNodus/react-qr-reader#361
@dmitry-zaets
Copy link

There are several PRs open addressing the same problem:
#343
#312

The repo is not actively maintained at the moment.
As a short-term solution, I've just published the forked version of the lib with peer deps and a couple of libraries' updated
@cmdnio/react-qr-reader. I've used the same semantic versioning to avoid the version collation.
Feel free to use the temporary solution if anyone else needs it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants