Uniswap / widgets

widgets-uniswap.vercel.app
GNU General Public License v3.0
123 stars 175 forks source link

I'm encountering an error whenever the uniswap widget loads in the browser (error is being logged an infinite number of times) #631

Open kr-arunp opened 2 months ago

kr-arunp commented 2 months ago

Bug Description getting error whenever the widget loaded in the browser

error: (**The following error is being logged an infinite number of times.) An unhandled error occurred processing a request for the endpoint "getTradeQuote". In the case of an unhandled error, no tags will be "provided" or "invalidated". TypeError: Cannot read properties of undefined (reading 'DAI_OPTIMISM_SEPOLIA') at Module.DAI_OPTIMISM_SEPOLIA (VM8327 index.js:38:132) at eval (VM8332 get-candidate-pools.js:51:49)

image

Versions: nextjs:14.1.4 React: 18.2.0 "ethers": "^5.7.2", "@uniswap/widgets": "2.59.0",

code uniswapWidget.tsx

import { SwapWidget } from '@uniswap/widgets' import '@uniswap/widgets/fonts.css

.... const jsonRpcUrlMap = { 137: ['https://polygon-mainnet.g.alchemy.com/v2/api_key'], 1: ["https://eth-mainnet.g.alchemy.com/v2/api_key] } const TOKEN_LIST = 'https://ipfs.io/ipns/tokens.uniswap.org' ......

....

i have tested the same issue with latest react+ vite as well image

bullishgopher commented 2 months ago

@kr-arunp I am getting another issue #632