frontend icon indicating copy to clipboard operation
frontend copied to clipboard

The Write Contract in the Contract details and TokenPageContent page has been loading

Open BainWang0 opened this issue 2 years ago • 9 comments

Description

After clicking the write contract button, it is still loading and cannot activate the wallet (such as metamask). Problem recurrence: 1 First switch the tab to Read Contract 2 Switch to Write Contract again 3 Call the contract interface to reproduce

Link to the page

https://eth.blockscout.com/address/0xdAC17F958D2ee523a2206206994597C13D831ec7?tab=write_contract

Steps to reproduce

  1. Download blockscout source code and deploy in development environment
  2. Click on Tokens in the navigation bar to find a contract address
  3. For details, find the Contract tab in the details page
  4. Switch between Read Contract and Write Contract in the subtab, and call the contract write interface to reproduce the problem. 221714298604_ pic

App version

v1.29.1

Browser

Google Chrome 124

Operating system

None

Additional information

image

BainWang0 avatar Apr 28 '24 10:04 BainWang0

I’m not sure if it’s related to the wss repeater in the picture below. 231714299083_ pic

BainWang0 avatar Apr 28 '24 10:04 BainWang0

Sorry, but I cannot reproduce it on eth.blockscout.com, everything seems to work fine, no errors in console.

Do you see the error on your local machine? Have you setup the WalletConnect integration properly?

tom2drum avatar Apr 29 '24 10:04 tom2drum

Sorry, but I cannot reproduce it on eth.blockscout.com, everything seems to work fine, no errors in console.

Do you see the error on your local machine? Have you setup the WalletConnect integration properly? image

  • The above error message was printed out after I added debugging information locally.
  • The picture above shows loading problems and console information in a certain network environment.
  • The environment variable NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID is configured

BainWang0 avatar Apr 29 '24 10:04 BainWang0

Still don't see any issues on my side. What kind of "debugging information" have you added?

tom2drum avatar Apr 29 '24 11:04 tom2drum

Still don't see any issues on my side. What kind of "debugging information" have you added?

The console.log information is output. When switching tabs, the problem as shown below will occur.

const { data: walletClient, error: err, failureReason: fail } = useWalletClient({}); console.log("======> ContractWrite ", walletClient, err, fail);

image

BainWang0 avatar May 06 '24 03:05 BainWang0

Related interface issues regarding the use of wagmi package in blockscout useDisconnect() returns error image

BainWang0 avatar May 06 '24 05:05 BainWang0

Could you try to reproduce it in the incognito mode? Or try to clear the browser cache and do it again. Will the error stay?

tom2drum avatar May 06 '24 08:05 tom2drum

Could you try to reproduce it in the incognito mode? Or try to clear the browser cache and do it again. Will the error stay?

Trying to clear the local cache and refreshing the page can solve the problem of calling wagmi package related interfaces, but the root cause is still not found. Is there any good solution at the code level?

BainWang0 avatar May 06 '24 10:05 BainWang0

  • Clear the cache corresponding to https://eth.blockscout.com in the browser or http://localhost:3000 running locally, refresh the page to use the wagmi-related interface, this verification page is on the token details page, switch Contract Click the tab to verify.
  • The token details page is forced to refresh the page. After switching Read Tab and Write Tab under contract several times, the problem of calling the wagmi package related interface will appear.
  • Local verification has the same problem as https://eth.blockscout.com/token/0xdAC17F958D2ee523a2206206994597C13D831ec7?tab=write_contract verification. You can force refresh the entire page several times and then switch tabs. The problem may appear. The problems I tracked locally are as follows screenshot above.
  • The picture below is a screenshot of my local output of key information to facilitate locating the problem. image

BainWang0 avatar May 06 '24 10:05 BainWang0

Not able to reproduce. Please try latest version if problem still exists

NikitaSavik avatar Jan 09 '25 11:01 NikitaSavik