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
Latest canary breaks the @prisma/client module #30279
Comments
Hi, can you share a repo with a minimal reproduction/a deployment with the error? |
I have made the repo public temporarily, here is the commit before I fixed it with the require the project that uses canary 97 that doesnt need the require but uses relative imports instead of src/... imports is here https://github.com/Floffah/adiutor/blob/master/packages/web/src/pages/api/auth/%5B...nextauth%5D.ts where the sign in will take you to discord as expected |
Thanks for the reproduction I opened a PR with a fix for this case here #30286 |
The above fix is now available in |
yep its working without the requires now, thank you! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.1.3-canary.100
What version of Node.js are you using?
14.x (vercel lts)
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
Vercel
Describe the Bug
In the latest canary, api handlers get the error
Error: Cannot find module '@prisma/client'
.I tested this using 11.1.3-canary.98 to 100 where the error occurs.
I also tested 11.1.3-canary.97 where theres no error. just as an extra case i tested in 11.1.2 and there is no error so its an issue with one >=11.1.3-canary.98 canary versions.
Expected Behavior
The @prisma/client module should be able to be found
To Reproduce
Create an api handler that references @prisma/client and try and send a request, should respond with 500 internal server error and the log drain should so the module error.
If needed i can provide my vercel deployment and access to the private repo where this issue occurs and i tested the 3 versions
Edit
I'm not completely sure if it is canary 98 that introduces the issue, I was going off of this as another of my websites uses the next-auth library as an api and it was on canary 97 and worked fine, on this i just tested 97 and it is also broken there however the only difference between this project using 97 and the other is that the file containing the prisma client instance is imported using src/lib/etc instead of ../../../lib/etc so it could be a module resolution thing similar to the old issue with apollo micro
i do know that it is a problem with 11.1.3 as i tested this using 11.1.2 on the library that had all 4 canary version broken instead of just the 3 and it worked fine on 11.1.2
yep confirmed this isnt an issue with 98 just canary as a whole as i ran require("@prisma/client") in the same file as the api handler
when i tested it using 11.1.2 it was definitely using the src/lib/etc path instead of ../../../ so its a module resolution issue with either swc or something introduced in canary
The text was updated successfully, but these errors were encountered: