Skip to content

Peer dependency error with react-location-devtools #257

Closed

Description

@AnimaLupi

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

Activity

  1. badsyntax commented on Jun 14, 2022

    @badsyntax
    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.

  2. jimmy-guzman commented on Oct 13, 2022

    @jimmy-guzman

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions