Code Monkey home page Code Monkey logo

Comments (18)

janpio avatar janpio commented on July 18, 2024 1

The Prisma code is pretty stable and used by hundreds of thousands of users - so I would suggest you look more into how you use Prisma Client and share that with us in a way we can properly reproduce and understand what you are doing.

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

image

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

@liuhuapiaoyuan Can you try adding engineType = "library" to the generator block in schema.prisma file and check if that resolves the issue?

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider   = "prisma-client-js"
  engineType = "library"
}

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

image
same error

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

I would assume that same thing happens with engineType = "binary" as well, right?

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

Do you get this error with a hosted database as well? What happens if you don't use a locally running database?

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

image
same error

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

Do you get this error with a hosted database as well? What happens if you don't use a locally running database?

I look at the code unless accelerate is used

image

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

Just to confirm, are you invoking npx prisma generate after adding engineType = "library"/"binary" to your schema file?

If not, could you run the prisma generate command and check?

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

Just to confirm, are you invoking npx prisma generate after adding engineType = "library"/"binary" to your schema file?

If not, could you run the prisma generate command and check?

Of course~~

Every time I make a modification, I have executed npx prisma generate

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

Thanks for confirming!
Does this happen on a stable version of Next.js as well? It looks like you are using canary version.

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

image

yes,i using canary version

but, i think is not Next.js error.

you can watch source code

from prisma.

nurul3101 avatar nurul3101 commented on July 18, 2024

When exactly do you get this error?
When you try to do a Prisma Client query?

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

image

It seems that instantiating the Prisma instance is wrong

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

This code can reproduce this error. You can try id .
https://github.com/liuhuapiaoyuan/nextjs-prisma-edge-bug

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

The Prisma code is pretty stable and used by hundreds of thousands of users - so I would suggest you look more into how you use Prisma Client and share that with us in a way we can properly reproduce and understand what you are doing.

I just want to solve the issue of accessing the database in edge within node-postgres. Is there absolutely no way due to the problem with node-postgres?

Additionally, my software actually needs to use sqlite, and I need to use prisma in the middleware of next.js, for example, some logging. My scenario does not allow me to use serverless services.

from prisma.

janpio avatar janpio commented on July 18, 2024

I just want to solve the issue of accessing the database in edge within node-postgres. Is there absolutely no way due to the problem with node-postgres?

Yes, node-postgres has a bug so it does not work in Next.js or deployed to Vercel, with or withour Prisma - nothing we at Prisma can do about that.

Additionally, my software actually needs to use sqlite, and I need to use prisma in the middleware of next.js, for example, some logging. My scenario does not allow me to use serverless services.

Next.js middleware always runs code in the "edge runtime", there is no way around that: https://nextjs.org/docs/app/building-your-application/routing/middleware#runtime

(Note: All these questions are off topic for this issue about Accelerate again. If you just want to have a discussion instead of report a bug, please open a discussion instead of an issue.)

from prisma.

liuhuapiaoyuan avatar liuhuapiaoyuan commented on July 18, 2024

OK OK , I understand. It's just that there is completely no way。

from prisma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.