wevm / viem

TypeScript Interface for Ethereum
https://viem.sh
Other
2.51k stars 796 forks source link

bug: <title> #539

Closed JirAcheron closed 1 year ago

JirAcheron commented 1 year ago

Is there an existing issue for this?

Package Version

0.3.30

Current Behavior

trying to build a project using parcel with the new rainbowkit and wagmi upgrades. below are what i believe to be the relevant dependencies:

 "devDependencies": {
    "parcel": "^2.8.0",
  }
 "dependencies": {
    "@rainbow-me/rainbowkit": "^1.0.0",
    "viem": "^0.3.30",
    "wagmi": "^1.0.5",
    ...
  },

parcel fails to resolve the paths whenever 'viem/ens' and viem/chains are referenced in the distribution directory (wagmi/core/dist/). i managed to get the app working locally by clearing out these reference segments from node modules, but any information regarding a solution for path resolution would be helpful

the full client-side dependencies can be found below:

  "devDependencies": {
    "@parcel/packager-css": "^2.8.0",
    "@parcel/transformer-raw": "^2.8.3",
    "@types/react": "^17.0.43",
    "@types/react-dom": "^18.0.4",
    "@types/styled-components": "^5.1.24",
    "@typescript-eslint/eslint-plugin": "^5.46.1",
    "@typescript-eslint/parser": "^5.46.1",
    "eslint": "^8.29.0",
    "parcel": "^2.8.0",
    "parcel-reporter-static-files-copy": "^1.4.0",
    "parcel-transformer-csv": "^0.0.3",
    "prettier": "^2.5.1",
    "threads": "^1.7.0",
    "tspath": "^2.6.8",
    "typescript": "^4.6.4"
  },
  "dependencies": {
    "@improbable-eng/grpc-web": "^0.15.0",
    "@latticexyz/network": "^1.34.0",
    "@latticexyz/phaserx": "^1.34.0",
    "@latticexyz/recs": "^1.34.0",
    "@latticexyz/services": "^1.30.1",
    "@latticexyz/std-client": "^1.30.1",
    "@rainbow-me/rainbowkit": "^1.0.0",
    "antd": "^5.4.3",
    "ethers": "^5",
    "mobx": "^6.7.0",
    "mobx-react-lite": "^3.4.0",
    "mqtt": "^4.3.7",
    "nice-grpc": "^2.1.4",
    "nice-grpc-web": "^3.3.0",
    "phaser": "3.60.0-beta.4",
    "proxy-deep": "^3.1.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "rxjs": "^7.5.5",
    "styled-components": "^5.3.6",
    "viem": "^0.3.30",
    "wagmi": "^1.0.5",
    "zustand": "^4.3.1"
  },

Expected Behavior

builds

Steps To Reproduce

No response

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

No response

jxom commented 1 year ago

Yeah, this is because Parcel doesn't support package.json#exports yet unfortunately.

Just opened a PR up at #540 as a workaround for Parcel and other bundlers that do not support it. You can give it a go by installing npm i viem@0.0.0-jxom-proxy-packages.20230519T060637.

jxom commented 1 year ago

Published a fix on 0.3.31.

github-actions[bot] commented 4 months ago

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.