npm run dev error
i installed all the prerequisite like node js but whem i run npm run dev it gives this error
Error: ErrorEvent at resolveErrorDev (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:1792:63) at processFullStringRow (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2071:17) at processFullBinaryRow (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2059:7) at progress (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js:2262:17)
node version v18.20.6 npm version v10.8.2 Next.js 15.1.6 i tries installing through node v 22LTS but still im facing the same issue cant figure this out help me if possible
node version v18.20.6 npm version v10.8.2 Next.js 15.1.6 i tries installing through node v 22LTS but still im facing the same issue cant figure this out help me if possible
if your database url in .env is localhost,make sure disable prisma adaper in prisam.ts and schema.prisma like this
// schema.prisma
generator client {
provider = "prisma-client-js"
// previewFeatures = ["driverAdapters"]
}
// prisam.ts
export const getPrisma = cache(() => {
// const neon = new Pool({ connectionString: process.env.DATABASE_URL });
// const adapter = new PrismaNeon(neon);
//return new PrismaClient({ adapter });
return new PrismaClient();
});
by following @annilq , i have explored how to fix the problem
i imported edge client normal
import { PrismaClient } from "@prisma/client/edge";
instead of this
import { PrismaClient } from "@prisma/client";
i added DATABASE_URL variable for using my prisma client
npx prisma migrate dev --name init
ran this code to create prisma client
Removed the adapter from the prisma client
const prisma = new PrismaClient({ });
This fixed the issue of the above
Thanks @annilq for help
by following @annilq , i have explored how to fix the problem
i imported edge client normal
import { PrismaClient } from "@prisma/client/edge"; instead of this
import { PrismaClient } from "@prisma/client"; i added DATABASE_URL variable for using my prisma client
npx prisma migrate dev --name init ran this code to create prisma client
Removed the adapter from the prisma client
const prisma = new PrismaClient({ }); This fixed the issue of the above
Thanks @annilq for help
我用了你的方法但是没有解决问题,请教一下你是怎么设置的。
by following @annilq , i have explored how to fix the problem
i imported edge client normal
import { PrismaClient } from "@prisma/client/edge"; instead of this
import { PrismaClient } from "@prisma/client"; i added DATABASE_URL variable for using my prisma client
npx prisma migrate dev --name init ran this code to create prisma client
Removed the adapter from the prisma client
const prisma = new PrismaClient({ }); This fixed the issue of the above
Thanks @annilq for help
我用了你的方法但是没有解决问题,请教一下你是怎么设置的。
在确认取消了适配器后也要执行数据库初始化操作,npx prisma genetate,npx prisma db push 等,你可以看看其他相关issue
by following @annilq , i have explored how to fix the problem i imported edge client normal import { PrismaClient } from "@prisma/client/edge"; instead of this import { PrismaClient } from "@prisma/client"; i added DATABASE_URL variable for using my prisma client npx prisma migrate dev --name init ran this code to create prisma client Removed the adapter from the prisma client const prisma = new PrismaClient({ }); This fixed the issue of the above Thanks @annilq for help
我用了你的方法但是没有解决问题,请教一下你是怎么设置的。
are you still facing the same issue?
by following @annilq , i have explored how to fix the problem i imported edge client normal import { PrismaClient } from "@prisma/client/edge"; instead of this import { PrismaClient } from "@prisma/client"; i added DATABASE_URL variable for using my prisma client npx prisma migrate dev --name init ran this code to create prisma client Removed the adapter from the prisma client const prisma = new PrismaClient({ }); This fixed the issue of the above Thanks @annilq for help
我用了你的方法但是没有解决问题,请教一下你是怎么设置的。
are you still facing the same issue?
Here's what I'm reporting as an error:
config and code:
#.env
DATABASE_URL="postgresql://postgres:123456@localhost:3718/together"
#lib\prisma.ts
import { PrismaClient } from "@prisma/client/edge";
import { PrismaNeon } from "@prisma/adapter-neon";
import { Pool } from "@neondatabase/serverless";
import { cache } from "react";
export const getPrisma = cache(() => {
const neon = new Pool({ connectionString: process.env.DATABASE_URL });
const adapter = new PrismaNeon(neon);
return new PrismaClient({ });
});
#prisma\schema.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
把neon和adapter注释掉
把neon和adapter注释掉
不行。现在是这样的报错 error:
#lib\prisma.ts
import { PrismaClient } from "@prisma/client";
import { PrismaNeon } from "@prisma/adapter-neon";
import { Pool } from "@neondatabase/serverless";
import { cache } from "react";
export const getPrisma = cache(() => {
// const neon = new Pool({ connectionString: process.env.DATABASE_URL });
// const adapter = new PrismaNeon(neon);
return new PrismaClient();
});
#prisma\schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
把page页面的runtine=edge注释掉试试
把page页面的runtine=edge注释掉试试
正常运行了!非常感谢。
[ Server ] Error: PrismaClient is not configured to run in Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware). In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
help me pls
solved this due to prisma version issue