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

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

Open
cnasc opened this issue Jan 11, 2023 · 18 comments
Open

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

cnasc opened this issue Jan 11, 2023 · 18 comments
Labels
bug Something isn't working

Comments

@cnasc
Copy link

cnasc commented Jan 11, 2023

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

  • noticed this at first on our Next.js app
  • Tried in a clean react codesandbox to reproduce the issue and confirm it wasn't local to my machine
  • manually adding jotai-immer and qs as dependencies to my project appears to resolve the issue
@cnasc cnasc added the bug Something isn't working label Jan 11, 2023
@Tomiblanchard
Copy link

Same!

@rharkor
Copy link

rharkor commented Jan 14, 2023

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

@zyrm
Copy link

zyrm commented Jan 16, 2023

Same

@just-toby
Copy link
Collaborator

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

@gilles-hemmerle
Copy link

Had the same issue, solved by doing:

-- npm i @uniswap/[email protected]
-- 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

@AliceW-03
Copy link

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

@wangliyue14
Copy link

Same

@wangliyue14
Copy link

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

@nneverlander
Copy link

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

@victaphu
Copy link

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
Copy link

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

@cnasc
Copy link
Author

cnasc commented Mar 14, 2023

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
Copy link

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 - #404 - disabling SSR worked for me.

@cnasc
Copy link
Author

cnasc commented Mar 14, 2023

Our swap component is already dynamically imported, unfortunately

@keirongulrajani
Copy link

Had the same issue, solved by doing:

-- npm i @uniswap/[email protected]
-- 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
Copy link

Is there anybody can resolve this issue

@dawb
Copy link

dawb commented Jun 28, 2023

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

@DeveloperTheExplorer
Copy link

Had the same issue, solved by doing:

-- npm i @uniswap/[email protected]
-- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests