lifinance / widget

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
https://li.fi/widget
Apache License 2.0
129 stars 85 forks source link

Can not build in Next.js 14 #262

Closed codeninja0415 closed 5 months ago

codeninja0415 commented 5 months ago

"dependencies": { "@lifi/sdk": "^3.0.0-beta.0", "@lifi/widget": "^3.0.0-beta.1", "@mui/material": "5.15.19", "@mui/material-nextjs": "5.15.11", "next": "14.2.3", "next-themes": "^0.3.0", "react": "^18.3.1", "react-cookie": "7.1.4", "react-dom": "^18.3.1" },

This is the dependencies and I got below error while building the project. Screenshot_4

Please help me to fix this issue, Thanks

chybisov commented 5 months ago

@codeninja0415 please upgrade to the latest versions of the Widget and SDK packages.

haroon-schmrkow commented 5 months ago

@chybisov what changed in lifi/sdk in latest version? I am getting an error that LiFi is not exported from lifi/sdk

import { LiFi } from "@lifi/sdk";

chybisov commented 5 months ago

@codeninja0415 @haroon-schmrkow hey, sorry, I meant the latest beta versions of v3, since you are using them.

haroon-schmrkow commented 5 months ago

@chybisov yep, that's what I went for, 3.0.0-beta.1 of lifi/sdk, and I get that error

chybisov commented 5 months ago

@haroon-schmrkow v3 of the SDK doesn't export LiFi anymore as it did in the v2. v3 has a different way of configuration. See the documentation draft here https://docs.li.fi/~/changes/H0SgWKmrfD4lwu1aLLDU/integrate-li.fi-sdk/configure-sdk and stay tuned for the migration guide and major release soon 🙂

codeninja0415 commented 5 months ago

@haroon-schmrkow , @chybisov , I built the project successfully by changing the tsconfig.json file like below. After updating the "target" from ES5 to ES2020, I could build the project successfully with the same version of @Lifi/SDK and @Lifi/Widget. Thanks :) image