Replies: 4 comments 3 replies
-
|
I see this error also while doing my migration 1.- Make sure that wagmi and viem are up to date with latest |
Beta Was this translation helpful? Give feedback.
-
|
Any solution on this? I'm facing the same issue... |
Beta Was this translation helpful? Give feedback.
-
|
@lilyanB @holy-pengy brother, Is there any solution to this.? When i run write(), I get this "TypeError: hex_.replace is not a function" error May be I am not passing bytes correctly, how should I pass that first argument? Suppose the string that I need to convert to bytes and pass as argument is "Hello World". I am using stringToBytes here. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe it will help someone. For me the order of arguments I was passing was wrong. One of them was misplaced. As soon as I adjusted them it worked fine, |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
context:
I use NextJS/typescript and wagmi for interact with EVM blockchain/contracts.
I want to interact with a contract.
When I use
useContractWrite:With text:
I have this error on my browser:
With "stringToBytes"
I have this error on my browser:
When I use
usePrepareContractWrite:Vscode display an error:

My code/project : https://github.com/lilyanB/coinlend/blob/writeContract/src/app/wbtc/page.tsx
If someone can help me please
Beta Was this translation helpful? Give feedback.
All reactions