Open au2001 opened 1 year ago
Same
Same
this is a known issue in our conedison
number formatting library. until we can fix it on that side, you can try mapping the library like we do in our interface: https://github.com/Uniswap/interface/blob/main/craco.config.cjs#L42
@just-toby which is the stable version ? If we are waiting for the conedison number formatting library to update ?
@ZiggStardust i don't think there's a breaking change in this repo - we've always remapped our imports of conedison
as shown in the link above.
@ZiggStardust vetsion 2.24.0
is working like a charm and is not missing any dependencies.
@ZiggStardust i don't think there's a breaking change in this repo - we've always remapped our imports of
conedison
as shown in the link above.
Here's what I tried for a NextJS app with version 2.25.0 or higher :
yarn add @uniswap/widgets
yarn dev
Hit with a Server Error
Error: Cannot find module '.../node_modules/@uniswap/conedison/dist/provider'
Remapping in next.config.js as advised by @just-toby
config.resolve.alias['@uniswap/conedison'] = '@uniswap/conedison/dist'
Hit with a Module not found
error
./node_modules/@uniswap/widgets/dist/clientSideSmartOrderRouter-3dbdcd6a.js:46:0
Module not found: Can't resolve '@uniswap/conedison/provider'
Had luck with disabling SSR for that particular component with a dynamic component: https://blog.bitsrc.io/using-non-ssr-friendly-components-with-next-js-916f38e8992c
@marcinciarka like that? const { SwapWidget, darkTheme, lightTheme } = dynamic( () => import('@uniswap/widgets'), { ssr: false }, );
Not sure if this will help, but I struggled with the dynamic imports until I did the following:
const SwapWidget = dynamic( async() => { const res = await import('@uniswap/widgets'); return res.SwapWidget; }, {ssr: false} )
I tried the above with what @misha256 mentioned but it threw an exception
this is a known issue in our
conedison
number formatting library. until we can fix it on that side, you can try mapping the library like we do in our interface: https://github.com/Uniswap/interface/blob/main/craco.config.cjs#L42
Following this advice in the resolve > alias
part of my webpack config seems to have resolved the issue for me too:
....
module.exports = {
...
resolve: {
alias: {
...
'@uniswap/conedison': '@uniswap/conedison/dist',
}
},
info - Collecting page data ...Error: Cannot find module '/Users/.../node_modules/@uniswap/conedison/dist/provider/signing'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1096:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1089:15)
at resolveExports (node:internal/modules/cjs/loader:565:14)
at Module._findPath (node:internal/modules/cjs/loader:634:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
at mod._resolveFilename (/Users/.../node_modules/next/dist/build/webpack/require-hook.js:23:32)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/Users/.../node_modules/@uniswap/widgets/dist/cjs/index-4f48ae8b.cjs:47:15) {
code: 'MODULE_NOT_FOUND',
path: '/Users/.../node_modules/@uniswap/conedison/package.json'
}
> Build error occurred
Error: Failed to collect page data for /
at /Users/.../node_modules/next/dist/build/utils.js:963:15 {
type: 'Error'
}
widget version: 2.51.2
info - Collecting page data ...Error: Cannot find module '/Users/.../node_modules/@uniswap/conedison/dist/provider/signing' at createEsmNotFoundErr (node:internal/modules/cjs/loader:1096:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:1089:15) at resolveExports (node:internal/modules/cjs/loader:565:14) at Module._findPath (node:internal/modules/cjs/loader:634:31) at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27) at mod._resolveFilename (/Users/.../node_modules/next/dist/build/webpack/require-hook.js:23:32) at Module._load (node:internal/modules/cjs/loader:920:27) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) at Object.<anonymous> (/Users/.../node_modules/@uniswap/widgets/dist/cjs/index-4f48ae8b.cjs:47:15) { code: 'MODULE_NOT_FOUND', path: '/Users/.../node_modules/@uniswap/conedison/package.json' } > Build error occurred Error: Failed to collect page data for / at /Users/.../node_modules/next/dist/build/utils.js:963:15 { type: 'Error' }
widget version: 2.51.2
same error here
Related issue https://github.com/Uniswap/widgets/issues/580
Bug Description Whenever I try to start or build my app, the following error is raised:
Steps to Reproduce
@uniswap/widgets
version2.25.0
or higherExpected Behavior The app should not throw an error.
Temporary Solution Downgrading to version
2.24.0
solves this issue.