pnpm / pnpm

Fast, disk space efficient package manager
https://pnpm.io
MIT License
29.5k stars 1k forks source link

Cannot find package react-ssr-prepass when using pnpm with next.js and @trpc/next #7399

Open shadowDarsan opened 10 months ago

shadowDarsan commented 10 months ago

Verify latest release

pnpm version

8.12.0

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

Start a new next js project with pnpm => pnpm create t3-app@latest

◇ What will your project be called? │ test │ ◇ Will you be using TypeScript or JavaScript?
│ TypeScript │ ◇ Will you be using Tailwind CSS for styling?
│ Yes │ ◇ Would you like to use tRPC? │ Yes │ ◇ What authentication provider would you like to use? │ None │ ◇ What database ORM would you like to use?
│ None │ ◇ EXPERIMENTAL Would you like to use Next.js AppRouter? │ No │ ◇ Should we initialize a Git repository and stage the changes? │ Yes │ ◇ Should we run 'pnpm install' for you? │ Yes │ ◇ What import alias would you like to use?
│ ~/

cd test pnpm dev

Describe the Bug

I am using pnpm version 10 with next.js version 13.4 and @trpc/next version 10.44.1. I have installed react-ssr-prepass as a dependency in my package.json file. However, when I try to run my project, I get the following error:

Cannot find package 'C:\Users\username\Documents\projectDevelopment\learning\next13.4\test\nodemodules.pnpm\@trpc+next@10.44.1@tanstack+react-query@4.36.1@trpc+client@10.44.1@trpc+react-query@10.44._ccre2jbgqlcjucpqgj7ehu2yh4\node_modules\react-ssr-prepass\package.json' imported from C:\Users\username\Documents\projectDevelopment\learning\next13.4\test\nodemodules.pnpm\@trpc+next@10.44.1@tanstack+react-query@4.36.1@trpc+client@10.44.1@trpc+react-query@10.44._ccre2jbgqlcjucpqgj7ehu2yh4\node_modules\@trpc\next\dist\index.mjs Did you mean to import react-ssr-prepass@1.5.0_react@18.2.0/node_modules/react-ssr-prepass/dist/react-ssr-prepass.js?

I have tried to delete the node_modules folder and the pnpm-locak-yaml file and reinstall the dependencies, but the error persists. I have also tried to update the react-ssr-prepass package to the latest version, but that did not help either. I have searched online for similar issues, but I could not find any solution.

This error does not occur when I use npm instead of pnpm. I suspect that there is some compatibility issue between pnpm and react-ssr-prepass, or between pnpm and @trpc/next. I would appreciate any help or guidance on how to fix this problem. Thank you.

Expected Behavior

Compiling of next app and run

Which Node.js version are you using?

20.10.0

Which operating systems have you used?

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

jaan1025 commented 10 months ago

similar problem with next@13.4.19 and pnpm@8 in docker build