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

Peer dependency error with react-location-devtools #257

Closed
AnimaLupi opened this issue Apr 7, 2022 · 2 comments
Closed

Peer dependency error with react-location-devtools #257

AnimaLupi opened this issue Apr 7, 2022 · 2 comments

Comments

@AnimaLupi
Copy link

Describe the bug

Hello, I'm experiencing this behaviour while installing the latest packages (see below).

Not a real issue, it's just a little bit annoying to force on all npm install I do (it complains even when installing other packages at later times), but I just wanted to report this in case nobody was aware yet.

Thank you for the awesome library by the way!

Your Example Website or App

N/A

Steps to Reproduce the Bug or Issue

Package.json containing:

"@tanstack/react-location": "^3.7.4",
"@tanstack/react-location-devtools": "^3.4.4"

(I wasn't unable to find a devtool version matching the react-location one)

When I run npm install I'm getting these errors:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @tanstack/[email protected]
npm ERR! Found: @tanstack/[email protected]
npm ERR! node_modules/@tanstack/react-location
npm ERR!   @tanstack/react-location@"^3.7.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @tanstack/react-location@"3.4.4" from @tanstack/[email protected]
npm ERR! node_modules/@tanstack/react-location-devtools
npm ERR!   dev @tanstack/react-location-devtools@"^3.4.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @tanstack/[email protected]
npm ERR! node_modules/@tanstack/react-location
npm ERR!   peer @tanstack/react-location@"3.4.4" from @tanstack/[email protected]
npm ERR!   node_modules/@tanstack/react-location-devtools
npm ERR!     dev @tanstack/react-location-devtools@"^3.4.4" 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.

If I run the command with the -f (force) switch, errors turn into warnings, the installation succeeds and I can see the devtools running in the app.

Expected behavior

Installation shouldn't give errors and proceed without the need to force it.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: N/A
  • Version: N/A
  • NodeJS: 16.14.2
  • npm: 8.6.0

Additional context

No response

@badsyntax
Copy link
Contributor

You can use npm 7 overrides:

"overrides": {
  "@tanstack/react-location-devtools": {
    "@tanstack/react-location": "^3.7.4"
  }
},

In addition to this, the docs are really confusing, as they state: No need to install anything extra, just: import { ReactLocationDevtools } from '@tanstack/react-location-devtools' which doesn't appear to be the case. This is not a great DX when trying to use this library for this first time.

@jimmy-guzman
Copy link

Or with pnpm, you can use allowedversions:

  "pnpm": {
    "peerDependencyRules": {
      "allowedVersions": {
        "@tanstack/react-location": "3.7.4"
      }
    }
  }

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

4 participants