P
Prisma•4w ago
max4tf

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?
6 Replies
Prisma AI Help
Prisma AI Help•4w ago
Skipping coffee for instant knowledge! Let's brew that AI answer now.
max4tf
max4tfOP•4w ago
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...
Prisma AI Help
Prisma AI Help•4w ago
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:
export default defineNuxtConfig({
// your other config
vite: {
resolve: {
alias: {
'.prisma/client/index-browser': './node_modules/.prisma/client/index-browser.js',
},
},
},
})
export default defineNuxtConfig({
// your other config
vite: {
resolve: {
alias: {
'.prisma/client/index-browser': './node_modules/.prisma/client/index-browser.js',
},
},
},
})
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:
hoist-pattern[]=*prisma*

hoist-pattern[]=*prisma*

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!
Nurul
Nurul•3w ago
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...
max4tf
max4tfOP•3w ago
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
Nurul
Nurul•3w ago
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.

Did you find this page helpful?