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

protons-runtime dependency not resolving to the latest compatible version #2174

Open
jacobmakarsky opened this issue Oct 10, 2024 · 4 comments
Assignees

Comments

@jacobmakarsky
Copy link

jacobmakarsky commented Oct 10, 2024

Error

SyntaxError: The requested module 'protons-runtime' does not provide an export named 'MaxLengthError'

Steps to Reproduce

  1. Install @waku/sdk
  2. Check the installed version of protons-runtime using yarn why protons-runtime.
  3. Observe that the installed version is 5.4.0 instead of the latest compatible version 5.5.0.

Problem

protons-runtime MaxLengthError class is currently used and is introduced in version 5.5.0, but install causes dependency protons-runtime 5.4.0 to be used.

Evidence

  1. See protons-runtime version comparison for add of MaxLengthError in latest version: protons-runtime versions comparison: ipfs/protons@protons-runtime-5.4.0...protons-runtime-5.5.0

  2. See usage in js-waku packages/proto/package.json:

    "protons-runtime": "^5.4.0"

  3. npm ls protons-runtime produces:

@waku/[email protected]
  ├─┬ @chainsafe/[email protected]
  │ ├─┬ @libp2p/[email protected]
  │ │ └── [email protected]
  │ └── [email protected]
  ├─┬ @libp2p/[email protected]
  │ ├─┬ @libp2p/[email protected]
  │ │ └── [email protected] deduped
  │ └── [email protected]
  ├─┬ @libp2p/[email protected]
  │ └─┬ @libp2p/[email protected]
  │   └── [email protected] deduped
  ├─┬ @waku/[email protected]
  │ └── [email protected] deduped
  └─┬ [email protected]
    ├─┬ @libp2p/[email protected]
    │ └── [email protected] deduped
    └─┬ @libp2p/[email protected]
      └── [email protected] deduped

Cause

It seems the @waku/sdk packages is not resolving to latest compatible version of protons-runtime (i.e, 5.5.0 or later) despite using the caret (^) in the version specification. I'm assuming it's because a few packages do not have ^5.4.0, so it defaults to 5.4.0 somehow.

Solution

Maybe patch @chainsafe/libp2p-gossipsub to use ^5.4.0?

Patching like so currently works (for anyone else having the issue): https://github.com/Railgun-Community/waku-broadcaster-client/blob/main/packages/web/patches/%40waku%2Bproto%2B0.0.8.patch

@danisharora099 danisharora099 self-assigned this Oct 10, 2024
@danisharora099
Copy link
Collaborator

Ah, right, I can confirm that 5.4.0 and 5.5.0 exist:

~/Developer/status/waku master *2 ?1 ❯ npm ls protons-runtime                                                                                      Node 18.20.4 15:22:04
@waku/root@ /Users/danisharora/Developer/status/waku
├─┬ @waku/[email protected] -> ./packages/core
│ └─┬ [email protected]
│   └─┬ @libp2p/[email protected]
│     └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/discovery
│ └─┬ @libp2p/[email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/enr
│ └─┬ @libp2p/[email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/interfaces
│ └─┬ @chainsafe/[email protected]
│   └── [email protected]
├─┬ @waku/[email protected] -> ./packages/proto
│ ├── [email protected]
│ └─┬ [email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/sdk
│ ├─┬ @chainsafe/[email protected]
│ │ └── [email protected] deduped
│ └─┬ @libp2p/[email protected]
│   ├─┬ @libp2p/[email protected]
│   │ └── [email protected] deduped
│   └── [email protected] deduped
└─┬ @waku/[email protected] -> ./packages/tests
  └─┬ @libp2p/[email protected]
    └── [email protected] deduped

@danisharora099
Copy link
Collaborator

This should actually be resolved by upgrading chainsafe/libp2p-gossipsub to 14.1.0 -- being done part of #2143 (as it requires other dependencies to be upgraded as well)

cc @weboko we might want to prioritize the libp2p upgrade part of the upcoming release

@danisharora099
Copy link
Collaborator

danisharora099 commented Oct 10, 2024

npm list from the above PR's branch -- no 5.4.0 spotted:

~/Dev/s/waku chore/libp2p-v2 *2 ❯ npm ls protons-runtime
@waku/root@ /Users/danisharora/Developer/status/waku
├─┬ @waku/[email protected] -> ./packages/core
│ └─┬ [email protected]
│   └─┬ @libp2p/[email protected]
│     └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/enr
│ └─┬ @libp2p/[email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/interfaces
│ └─┬ @chainsafe/[email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/proto
│ ├── [email protected]
│ └─┬ [email protected]
│   └── [email protected] deduped
├─┬ @waku/[email protected] -> ./packages/sdk
│ ├─┬ @chainsafe/[email protected]
│ │ └── [email protected] deduped
│ └─┬ @libp2p/[email protected]
│   ├─┬ @libp2p/[email protected]
│   │ └── [email protected] deduped
│   └── [email protected] deduped
└─┬ @waku/[email protected] -> ./packages/tests
  └─┬ @libp2p/[email protected]
    └── [email protected] deduped

@jacobmakarsky
Copy link
Author

A developer tagged https://github.com/Railgun-Community/waku-broadcaster-client/blob/main/packages/common/yarn.lock#L6476-L6491 , where the project linked above (the patch file) has a yarn.lock file with 5.4.0. Killing that file and running yarn after fixed and used 5.5.0 in the node modules. Leaving this here in case anyone else runs into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review / QA
Development

No branches or pull requests

2 participants