wevm / viem

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

bug: TypeError: x.replace is not a function #1272

Closed mentasuave01 closed 1 year ago

mentasuave01 commented 1 year ago

Is there an existing issue for this?

Package Version

1.10.4

Current Behavior

Same code I didn't change a thing. Only a few things in wagconfig to make the migration but the rest should work. The only change is from view 0.3.36 to 1.10.4 on package.json, it must be something wrong but I cannot figure out what is wrong error:

const { config, error } = usePrepareContractWrite({...data})

error: TypeError: x.replace is not a function at eval (webpack-internal:///(:3080/app-client)/./node_modules/.pnpm/viem@1.7.0_typescript@5.0.4/node_modules/viem/dist/esm/utils/data/concat.js:26:51) at Array.reduce (<anonymous>) at concatHex (webpack-internal:....)

Working package.json


  {
  "name": "test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "next dev -p 3080",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "connectkit": "1.5.0",
    "ethers": "^6.6.2",
    "lodash": "^4.17.21",
    "next": "^13.4.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sweetalert2": "^11.7.23",
    "sweetalert2-react-content": "^5.0.7",
    "usehooks-ts": "^2.9.1",
    "viem": "~0.3.36",
    "wagmi": "1.0.6"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.195",
    "@types/node": "^17.0.31",
    "@types/react": "^18.0.9",
    "@types/react-dom": "^18.0.3",
    "eslint": "^8.15.0",
    "eslint-config-next": "^12.1.6",
    "lokijs": "^1.5.12",
    "node-fetch": "^3.3.1",
    "pino": "^8.14.1",
    "pino-pretty": "^10.0.1",
    "typescript": "^5.0.4"
  }
}

Error Json:
{
  "name": "widget",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "next dev -p 3080",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "connectkit": "1.5.0",
    "ethers": "^6.6.2",
    "lodash": "^4.17.21",
    "next": "^13.4.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sweetalert2": "^11.7.23",
    "sweetalert2-react-content": "^5.0.7",
    "usehooks-ts": "^2.9.1",
    "viem": "1.10.4",
    "wagmi": "1.0.6"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.195",
    "@types/node": "^17.0.31",
    "@types/react": "^18.0.9",
    "@types/react-dom": "^18.0.3",
    "eslint": "^8.15.0",
    "eslint-config-next": "^12.1.6",
    "lokijs": "^1.5.12",
    "node-fetch": "^3.3.1",
    "pino": "^8.14.1",
    "pino-pretty": "^10.0.1",
    "typescript": "^5.0.4"
  }
}

### Expected Behavior

_No response_

### 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

Thanks for reporting. Can you please provide a minimal reproducible example via https://new.viem.sh or a separate repo? It will save us a lot of time reproducing your config & environment, and trying to reproduce your issue. See Why reproductions are required.

Please reopen this issue when a reproduction is added.

github-actions[bot] commented 5 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.