Skip to content

[BUG] Slow Installation and Dependency Conflict with near-api-js and @near-wallet-selector/core #2382

Open
@Amira1502

Description

Description

Issue Summary:

  1. Slow Installation:

    • Initially attempted to install all required packages (near-api-js, @near-wallet-selector/core, @near-wallet-selector/my-near-wallet, @near-wallet-selector/ledger, @near-wallet-selector/modal-ui) together:

      npm install near-api-js @near-wallet-selector/core @near-wallet-selector/my-near-wallet @near-wallet-selector/ledger @near-wallet-selector/modal-ui

image

  • The installation process was extremely slow and never completed successfully on both WSL and macOS.
  1. Error When Installing Individually:

    • Decided to install the packages one by one to diagnose the issue. Encountered a dependency conflict when installing @near-wallet-selector/core:

      npm install @near-wallet-selector/core
    • The error indicates a conflict between [email protected] and the peer dependency required by @near-wallet-selector/core ([email protected]).


Steps to Reproduce:

  1. Create a new Next.js application:

    npx create-next-app@latest my-app
    cd my-app
  2. Attempt to install all packages together:

    npm install near-api-js @near-wallet-selector/core @near-wallet-selector/my-near-wallet @near-wallet-selector/ledger @near-wallet-selector/modal-ui
    • Observe slow installation and failure.
  3. Try installing the packages one by one:

    npm install near-api-js
    npm install @near-wallet-selector/core
    • Encounter the following error when installing @near-wallet-selector/core:

    image

Error Log:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/near-api-js
npm ERR!   near-api-js@"^5.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer near-api-js@"4.0.3" from @near-wallet-selector/[email protected]
npm ERR! node_modules/@near-wallet-selector/core
npm ERR!   @near-wallet-selector/core@"^8.9.15" from the root project

Environment:

Page URL

https://docs.near.org/build/web3-apps/integrate-contracts

Impact

  • Incorrect information
  • Missing information
  • Unclear explanation
  • Broken link
  • Code example doesn't work
  • Other (please specify in description)

Suggested Fix

Suggestions:

  1. Update Documentation:

    • Specify compatible versions of near-api-js and @near-wallet-selector/core. Example:

      npm install [email protected] @near-wallet-selector/core
    • Provide guidance for resolving dependency issues using --legacy-peer-deps or --force.

  2. Improve Package Compatibility:

    • Update @near-wallet-selector/core to support the latest version of near-api-js (5.0.1).

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

  • Status

    In Progress 🏗️

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions