[turborepo] Usage of Recoil in Nextjs app induces a TypeError: TypeError: Cannot destructure property 'ReactCurrentDispatcher' of '__TURBOPACK__imported__ #8373
Replies: 4 comments 14 replies
-
Do I need to create an issue for this discussion or this will be suffice ? |
Beta Was this translation helpful? Give feedback.
-
Here's my package.json code for the next-app, store and root turborepo. Replace these and try installing recoil in the root folder. It should work. https://opposite-wax-112.notion.site/package-json-for-all-3-9f68dd2d5e204ce783f24c5c319ef515 |
Beta Was this translation helpful? Give feedback.
-
After banging my head on this issue for hours, now i think the problem lies with Recoil not supporting React 19 RC that came out last month(check out this issue in recoil's repo facebookexperimental/Recoil#2318 ). |
Beta Was this translation helpful? Give feedback.
-
"next": "^14.1.1",
module.exports = { }; |
Beta Was this translation helpful? Give feedback.
-
Summary
I have added store as package in the turborepo, which contains Recoil as state management. A hook named "useBalance" was added, which returns the state of an atom.(basic unit of recoil). Exported the hook file. Added the "store" package as dependency to the Next.js app.
The issue arises whenever I try to invoke "useBalance" hook in the Next.js app.
Steps taken to solve the issue:
Steps to reproduce the issue:
https://github.com/tsdineshjai/PayTM_Repo
Navigate to apps/user-app and npm run dev. Click localhost:3000
Key Issue: Integration issue of Recoil into NextJs app
Additional information
Example
https://github.com/tsdineshjai/PayTM_Repo
Beta Was this translation helpful? Give feedback.
All reactions