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

Error: This component must be used inside a <RecoilRoot> component. #2

Closed
AkifumiSato opened this issue Jul 9, 2022 · 2 comments
Closed

Comments

@AkifumiSato
Copy link
Collaborator

I tried to develop with yarn add link:<local path> and got the following error

Server Error
Error: This component must be used inside a <RecoilRoot> component.

It seems to be related to the following issue, but I tried it with reac@17 and recoil@0.7.2 and got an error.
facebookexperimental/Recoil#1802

@koichik
Copy link
Member

koichik commented Jul 9, 2022

Probably it is caused by a conflict between two Recoil packages.

  • <app>/node_modules/recoil
  • <recoil-sync-next>/node_modules/recoil

Can you try the following steps?

cd <app>
yarn unlink recoil-sync-next

cd <recoil-sync-next>
yarn unlink
yarn pack

cd <app>/node-modules
tar zxf <recoil-sync-next>/recoil-sync-next-v0.0.0.tgz
mv package recoil-sync-next
cd ..
yarn dev

@AkifumiSato
Copy link
Collaborator Author

Thanks, It worked!
l close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants