-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Error nuxt / prisma : Invalid module ".prisma" is not a valid package name imported from ...\node_modules\@prisma\client\default.js #27274
Description
Hi everyone, i'm working on a personnal web project with nuxt and prisma. When i try to build my project i have this error (title). I tried several solutions to solve it but none worked. Maybe i made a mistake ?
Can i get some help ?
Here are some files that may be useful:
package.json : {
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@prisma/client": "^6.8.2"?
"nuxt": "^3.16.2",
"
},
"devDependencies": {
"prisma": "^6.8.2",
}
}
nuxt.config;ts :
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
css: ['/assets/css/main.css'],/plugins/pinia.js'],
components: true,
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
plugins: ['
modules: [
'@vueuse/nuxt'
],
build: {
transpile: ['@motionone/vue']
}
})
prisma.ts : import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export default prisma;
schema.prisma : generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
ERROR Invalid module ".prisma" is not a valid package name imported from ...\node_modules@prisma\client\default.js