Uniswap / widgets

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

Could not find dependency: 'jotai-immer' when using SwapWidget #374

Open cnasc opened 1 year ago

cnasc commented 1 year ago

Bug Description After installing @uniswap/widgets and importing SwapWidget, a DependencyNotFound error for jotai-immer throws.

Steps to Reproduce

Codesandbox here

  1. install @uniswap/widgets per the readme
  2. try to use SwapWidget
  3. error occurs

Expected Behavior After following the installation steps in the readme, SwapWidget is usable without error.

Additional Context image

Tomiblanchard commented 1 year ago

Same!

rharkor commented 1 year ago

Same, and when I fix it it says error - Error: Cannot find module '***/node_modules/@uniswap/conedison/dist/format'

zyrm commented 1 year ago

Same

just-toby commented 1 year ago

see #404 for a suggestion on a fix/workaround. this should help resolve the conedison issue until we can update that library.

gilles-hemmerle commented 1 year ago

Had the same issue, solved by doing:

-- npm i @uniswap/widgets@1.1.1
-- npm i react/redux
-- npm i jotai-immer

and it should work.

This makes the project building properly and run.

However, in my application it seems that after this I get thousands of deprecated error occuring in an infinite loop. Then the swap button is always greyed out. I don't know if it is linked but I see no other reason for this button to stay deactivated.

image

dai-ki-web commented 1 year ago

After manually adding jotai-immer,the console loops indefinitely warning:use useSetAtom from jotai instead. image

wangliyue14 commented 1 year ago

Same

wangliyue14 commented 1 year ago

And uniswap widget doesn't show some tokens.. wondering it's related to this deprecated warning

nneverlander commented 1 year ago

same issue as above - After manually adding jotai-immer,the console loops indefinitely warning:use useSetAtom from jotai instead.

victaphu commented 1 year ago

For anyone having issues with a bunch of infinite loops about deprecated warnings, add this to your package.json of your project: "jotai": "~1.3.7",

What I noticed was that in the demo code (cosmos) it worked fine, but in newer versions (nextjs etc) jotai was auto-upgraded to 1.18.1 (which has all the weird breaking changes). So the above code simply forces npm to use the compatible jotai version (it gets bumped to 1.3.9 but that's still fine).

marcinciarka commented 1 year ago

This issue is fixed on 2.47.10, you can remove jotai and jotai-immer from your dependencies.

cnasc commented 1 year ago

Hm, I can't confirm whether 2.47.10 fixes, upon upgrading and removing I get the following error:

Error: Cannot find module 'node_modules/@uniswap/widgets/node_modules/@uniswap/conedison/dist/provider/signing'

I have attempted creating an alias per the suggestion in #404, however that simply yields a slightly different error:

Module not found: Can't resolve '@uniswap/conedison/provider/signing'
marcinciarka commented 1 year ago

Hm, I can't confirm whether 2.47.10 fixes, upon upgrading and removing I get the following error:

This is a different issue, caused by some export shenanigans uniswap has. Use the fixes from here - https://github.com/Uniswap/widgets/issues/404 - disabling SSR worked for me.

cnasc commented 1 year ago

Our swap component is already dynamically imported, unfortunately

keirongulrajani commented 1 year ago

Had the same issue, solved by doing:

-- npm i @uniswap/widgets@1.1.1
-- npm i react/redux
-- npm i jotai-immer

and it should work.

This makes the project building properly and run.

However, in my application it seems that after this I get thousands of deprecated error occuring in an infinite loop. Then the swap button is always greyed out. I don't know if it is linked but I see no other reason for this button to stay deactivated.

image

I was experiencing the same issue and I asked on their discord - someone pointed out there is a permit2 prop you can add in the widget (funnily enough i can't see it anywhere in the docs) but it does sort this issue of the greyed out review swap button

nmaddp1995 commented 1 year ago

Is there anybody can resolve this issue

dawb commented 1 year ago

Have tried the fixes above but doesn't resolve the issue unfortunately. Is there another potential resolution to this issue?

DeveloperTheExplorer commented 9 months ago

Had the same issue, solved by doing:

-- npm i @uniswap/widgets@1.1.1
-- npm i react/redux
-- npm i jotai-immer

and it should work.

This makes the project building properly and run. However, in my application it seems that after this I get thousands of deprecated error occuring in an infinite loop. Then the swap button is always greyed out. I don't know if it is linked but I see no other reason for this button to stay deactivated. image

I was experiencing the same issue and I asked on their discord - someone pointed out there is a permit2 prop you can add in the widget (funnily enough i can't see it anywhere in the docs) but it does sort this issue of the greyed out review swap button

Absolute lifesaver, for those who may have missed it, add the permit2 prop to SwapWidget.