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

Toast doesn't show on clipboard click #21

Closed
2 tasks
achampagnedev opened this issue Aug 30, 2022 · 5 comments
Closed
2 tasks

Toast doesn't show on clipboard click #21

achampagnedev opened this issue Aug 30, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@achampagnedev
Copy link
Contributor

achampagnedev commented Aug 30, 2022

I noticed that the success toast for copy to clipboard doesn't show.

The console shows this error when clicking on the button:

image

This feature is in two components:

  • Referral page /referral component: components/src/Referral/Form.tsx line 43
  • Profile page /users/* component: components/src/User/Profile/Info.tsx line 68
@achampagnedev achampagnedev added the bug Something isn't working label Aug 30, 2022
@NicolasMahe
Copy link
Member

Same issue on toast in packages/components/src/Token/Form/Create.tsx.
Got the issue on liteflow-nft-ropsten but not on demo-bsc-testnet marketplace.

@NicolasMahe
Copy link
Member

NicolasMahe commented Aug 30, 2022

I tried previous version of liteflow-nft-ropsten, specially before the switch from tsdx to tsc, and the toast are never displayed when they are trigger from the components.
Could it be related to next that import the nft libs in a different way when it's from the monorepo than from npm install?

@NicolasMahe
Copy link
Member

NicolasMahe commented Aug 31, 2022

I did some research yesterday night and I find out that we have the @chakra-ui/react and a 2 others (i think dependencies of chakra) dependencies in the node_modules of both apps and both packages components and templates:

apps/admin/node_modules/@chakra-ui/react
apps/test/node_modules/@chakra-ui/react
packages/components/node_modules/@chakra-ui/react
packages/templates/node_modules/@chakra-ui/react

Even worst, each XXX/node_modules/@chakra-ui/react contains a node_modules with more chakra deps!
I think this is causing the issue as the instance of ChakraProvider or ToastProvider may be duplicated depending where the source code lives.
On the clients' app (eg: onlyshoot) this is not the case, we have a single @chakra-ui folder in the root's node_modules containing all the chakra deps, no duplication in the node_modules/@nft/XXX libs:

node_modules/@chakra-ui/react
node_modules/@chakra-ui/...

I tried to solve this issue using the command npm dedupe without success. The goal of this command is to move to a higher level common dependencies. I think we have conflicting version of dependencies that prevent @chakra-ui to live in the root's node_modules

@EmmanuelDrouin EmmanuelDrouin changed the title Referral system: Toast doesn't show on clipboard click Toast doesn't show on clipboard click Sep 28, 2022
@antho1404 antho1404 transferred this issue from another repository Oct 26, 2022
@antho1404
Copy link
Member

While reorganizing the repo, I did solve this issue with duplication of chakra.
I cannot reproduce the issue with the toast.
Could you test again on your side and close the issue if this is fixed

@antho1404
Copy link
Member

closing this one as no activity and from my tests everything has been fixed with my previous comment

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

3 participants