Prisma Error After Nuxt 3.16.0 & Nitro 2.11.6 Update
Hey everyone,
after updating to Nuxt 3.16.0 and Nitro 2.11.6, I'm getting this error during build related to Prisma: TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module ".prisma" is not a valid package name imported from node_modules/@prisma/client/default.js There's also a deprecation warning: [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field... Looks like Prisma Client might be the cause. Has anyone else experienced this or found a workaround?
after updating to Nuxt 3.16.0 and Nitro 2.11.6, I'm getting this error during build related to Prisma: TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module ".prisma" is not a valid package name imported from node_modules/@prisma/client/default.js There's also a deprecation warning: [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field... Looks like Prisma Client might be the cause. Has anyone else experienced this or found a workaround?
6 Replies
Skipping coffee for instant knowledge! Let's brew that AI answer now.
Here is the related Prisma GitHub discussion: https://github.com/prisma/prisma/issues/26565
GitHub
After upgrading the Nuxt3 project to the latest version, an error o...
(node:12996) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at E:\src\xxxxxxx\node_m...
I can help with your Prisma error after updating Nuxt and Nitro. This is a known issue related to module resolution between Prisma Client and certain bundlers/frameworks.
The error you're seeing is related to how Prisma Client resolves its internal modules, particularly with the
.prisma/client
path. This issue commonly occurs with Nuxt and other frameworks that use bundlers like Vite.
Solution
You can resolve this by adding an alias configuration in your nuxt.config.ts
file:
This configuration helps the bundler correctly resolve the Prisma Client module paths during build time. This solution is officially documented in the Prisma documentation for Nuxt integration Using the Nuxt Prisma Module.
Additional considerations:
1. If you're using pnpm
, you might need to add a .npmrc
file with the following configuration:
2. If the above solution doesn't work, you might need to try downgrading Prisma to a more compatible version or check if there's a specific version compatibility issue between your Prisma version and Nuxt 3.16.0.
3. Some users have reported success with more complex alias configurations for different package managers. If you're still experiencing issues, please share which package manager you're using (npm, yarn, pnpm).
This is a relatively common issue that occurs after framework updates, and the alias configuration is the most straightforward solution.
ā
Great, thanks for letting us know that this solved your question!Hey!
Did you had a chance to look at this reply?
https://github.com/prisma/prisma/issues/26565#issuecomment-2788573150
GitHub
After upgrading the Nuxt3 project to the latest version, an error o...
(node:12996) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at E:\src\xxxxxxx\node_m...
The error is back š«
Invalid module ".prisma" is not a valid package name imported from C:\XXXX\XXXX\XXXX\XXXX\XXXX\XXXX\node_modules@prisma\client\default.js
Yes but it didnt worked for me
Hmm, I see you added a comment on the GitHub Issue. I would recommend waiting for our ORM team to provide their recommendation. This is a pretty new change with version 6.6.0.