Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'DAI_OPTIMISM_SEPOLIA') #523

Open
alicercedigital opened this issue Apr 4, 2024 · 5 comments

Comments

@alicercedigital
Copy link

alicercedigital commented Apr 4, 2024

  • I'm submitting a ...
    [X] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    On version 3.26.1 we are getting this error:
    Cannot read properties of undefined (reading 'DAI_OPTIMISM_SEPOLIA')

We are using Base Network and ethers.Web3Provider with MetaMask.

    "@uniswap/sdk": "^3.0.3",
    "@uniswap/sdk-core": "^4.2.0",
    "@uniswap/smart-order-router": "3.26.1",
    "@uniswap/v2-periphery": "1.1.0-beta.0",
    "@uniswap/v2-sdk": "^4.3.0",
    "@uniswap/v3-core": "^1.0.1",
    "@uniswap/v3-periphery": "^1.4.4",
    "@uniswap/v3-sdk": "^3.11.0",

On NextJS 14.1.4

This error is comming from:

get-candidate-pools.js

const baseTokensByChain = {
   ...
    [ChainId.OPTIMISM_SEPOLIA]: [
        DAI_OPTIMISM_SEPOLIA, <- When try to read this we have this error.
        USDC_OPTIMISM_SEPOLIA,
        USDT_OPTIMISM_SEPOLIA,
        WBTC_OPTIMISM_SEPOLIA,
    ],
   ...
};

token_provider__WEBPACK_IMPORTED_MODULE_20_.DAI_OPTIMISM_SEPOLIA;

It Happens when we try to create alpha router:

 const router = new AlphaRouter({
  chainId: baseNetwork.chainId,
  provider: metaMaskProvider,
 });

On version 3.19 this error does not happens, but then we have another different error so we need to upgrade.

  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
@Akhilesh-solutelabs
Copy link

@jsy1218 Reminder : We're unable to proceed with local development without manual fix in package, Would highly appreciate if you could spare some time this week and push the fix out on the minor import issue we discussed ( in #518 (comment) ) which fixes the above error of Cannot read properties of undefined (reading 'DAI_OPTIMISM_SEPOLIA') as shown above.

@Rahat47
Copy link

Rahat47 commented Jul 9, 2024

This issue is still around on version: '3.35.12' ... can't use the SDK at all

@Universal-Hacker
Copy link

any update on this?

@enghamzasalem
Copy link

is it solved?

@TechGeorgii
Copy link

is it solved?

No.

For me SDK works when I don't use webpack. Webpack gives the error above.

@xrsv , @jsy1218 can you look at this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants