Skip to content

You must mention all peer dependencies in package.json #227

@sbeben

Description

@sbeben

Guys, in your packages, for example in @v4-sdk, you import a lot of stuff from 'ethers/lib/utils', which is compatible with ethers v5 but not with v6.
Screenshot 2024-12-19 at 22 17 14

But, since it's not presented in any of package.json files, your imports are referencing workspace's ethers version, which is in a lot of times v6.
So, this leads to build crashes with Package subpath './lib/utils' is not defined by "exports" error across the globe.

For the ones who's seeing it, this resolves the issue.

//package.json
{
  "pnpm": {
    "packageExtensions": {
      "@uniswap/v4-sdk@*": {
        "dependencies": {
          "ethers": "5.7.2",
        }
      }
    }
  },
  "overrides": {
    "@uniswap/v4-sdk@*": {
      "ethers": "5.7.2"
    }
  },
  "resolutions": {
    "@uniswap/v4-sdk/ethers": "5.7.2"
  }
}

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