Open tsdineshjai opened 5 months ago
Can anyone look into this ?
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
Is there anyway I can bring anyone notice to this ?
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
Commenting here as well:
I was facing the same issue, finally found what was wrong. So here are a few steps that may help you :
Turbo will now install recoil in the root folder node_modules alongwith all other dependencies/libraries and make it available for those that added it as a dependency. As turborepo does build system orchestration we need to specify the relevant dependencies for each of the workspaces as and when used. (Workspaces as in packages and apps(mentioning for clarity)).
Commenting here as well:
I was facing the same issue, finally found what was wrong. So here are a few steps that may help you :
1. Remove node_modules, turbo cache(.turbo folder) and package-lock.json file from the root folder. (for uninstalling all dependencies and clearing the cached files). 2. Add "recoil" as a dependency in both, web/doc's package.json and packages/store's (the atoms store's) package.json 3. Then again install dependencies in the root folder.
Turbo will now install recoil in the root folder node_modules alongwith all other dependencies/libraries and make it available for those that added it as a dependency. As turborepo does build system orchestration we need to specify the relevant dependencies for each of the workspaces as and when used. (Workspaces as in packages and apps(mentioning for clarity)).
Commenting here as well:
I was facing the same issue, finally found what was wrong. So here are a few steps that may help you :
1. Remove node_modules, turbo cache(.turbo folder) and package-lock.json file from the root folder. (for uninstalling all dependencies and clearing the cached files). 2. Add "recoil" as a dependency in both, web/doc's package.json and packages/store's (the atoms store's) package.json 3. Then again install dependencies in the root folder.
Turbo will now install recoil in the root folder node_modules alongwith all other dependencies/libraries and make it available for those that added it as a dependency. As turborepo does build system orchestration we need to specify the relevant dependencies for each of the workspaces as and when used. (Workspaces as in packages and apps(mentioning for clarity)).
I got your comment. Thanks. I will respond to you if these steps are working.
Commenting here as well: I was facing the same issue, finally found what was wrong. So here are a few steps that may help you :
1. Remove node_modules, turbo cache(.turbo folder) and package-lock.json file from the root folder. (for uninstalling all dependencies and clearing the cached files). 2. Add "recoil" as a dependency in both, web/doc's package.json and packages/store's (the atoms store's) package.json 3. Then again install dependencies in the root folder.
Turbo will now install recoil in the root folder node_modules alongwith all other dependencies/libraries and make it available for those that added it as a dependency. As turborepo does build system orchestration we need to specify the relevant dependencies for each of the workspaces as and when used. (Workspaces as in packages and apps(mentioning for clarity)).
Commenting here as well: I was facing the same issue, finally found what was wrong. So here are a few steps that may help you :
1. Remove node_modules, turbo cache(.turbo folder) and package-lock.json file from the root folder. (for uninstalling all dependencies and clearing the cached files). 2. Add "recoil" as a dependency in both, web/doc's package.json and packages/store's (the atoms store's) package.json 3. Then again install dependencies in the root folder.
Turbo will now install recoil in the root folder node_modules alongwith all other dependencies/libraries and make it available for those that added it as a dependency. As turborepo does build system orchestration we need to specify the relevant dependencies for each of the workspaces as and when used. (Workspaces as in packages and apps(mentioning for clarity)).
I got your comment. Thanks. I will respond to you if these steps are working.
It didnt work for me.
I am also facing the same problem please update here if you find a solution.
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
Had the same issue I solved it by adding a new nextJS project with "pnpx create-next-app@latest" in my apps folder HOW DID THAT FIX IT? => So when you initialize a new turborepo, the nextjs version it uses for already added docs and web app is "15.0.0-rc.0" and same for react (19.0.0-rc-f994737d14-20240522) and react-dom (19.0.0-rc-f994737d14-20240522) here rc stands for the release candidate version which is not stable right now and vercel did say they will release a stable version of nextjs 15 soon here: https://nextjs.org/blog/next-15-rc So till then you might want to use nextjs 14 which is stable
Had the same issue I solved it by adding a new nextJS project with "pnpx create-next-app@latest" in my apps folder HOW DID THAT FIX IT? => So when you initialize a new turborepo, the nextjs version it uses for already added docs and web app is "15.0.0-rc.0" and same for react (19.0.0-rc-f994737d14-20240522) and react-dom (19.0.0-rc-f994737d14-20240522) here rc stands for the release candidate version which is not stable right now and vercel did say they will release a stable version of nextjs 15 soon here: https://nextjs.org/blog/next-15-rc So till then you might want to use nextjs 14 which is stable
They also mentioned this in here https://nextjs.org/blog/next-15-rc :
To make it work in your current directory:
go to your apps/your-app folder which is using the release candidate version and do:
pnpm remove next react react-dom
then install all the stable versions by doing:
pnpm add next@latest react@latest react-dom@latest
also make sure to do a install on your root folder as well by doing:
pnpm i
now it should work
pnpm run dev
Recoil is not compatible with React 19 https://github.com/facebookexperimental/Recoil/issues/2318
If the Next.js version you're using is 14 or higher, downgrade it to 13.
do not use react 19 or higher
Link to the code that reproduces this issue
https://github.com/tsdineshjai/PayTM_Repo
To Reproduce
Current vs. Expected behavior
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.
The expected result should be a text on the page showing "the balance is 0", instead we get a unhandled runtime error.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, Output (export/standalone)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I have already raised the issue in turborepo GitHub repo as a discussion, assuming this is an issue related to turborepo. link: https://github.com/vercel/turbo/discussions/8373
I have been redirected here to post as an issue to get a guidance on the issue.
Note : There is no issue for the same code if it's a standalone application of turbopack. But it arises while using it in monorepo.