Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

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

@kr-arunp

Description

@kr-arunp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions