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

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

Open
2 of 6 tasks
Amira1502 opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Amira1502
Copy link
Contributor

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 near-api-js@5.0.1 and the peer dependency required by @near-wallet-selector/core (near-api-js@4.0.3).


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: my-app@0.1.0
npm ERR! Found: near-api-js@5.0.1
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/core@8.9.15
npm ERR! node_modules/@near-wallet-selector/core
npm ERR!   @near-wallet-selector/core@"^8.9.15" from the root project

Environment:

  • OS: WSL 2 and macOS Monterey
  • Node.js: 22.12.0
  • Packages:
    • near-api-js@5.0.1
    • @near-wallet-selector/core@8.9.15

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 near-api-js@4.0.3 @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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: NEW❗
Status: No status
Development

No branches or pull requests

1 participant