https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-client
  • d

    Dominic Hadfield

    11/29/2020, 9:16 PM
    can anyone assist, we are getting an intermittent error that is increasing slowly in production:
    Copy code
    TypeError: Cannot read property 'onError' of undefined
    at Socket.onSocketClose (/var/task/node_modules/@prisma/client/runtime/index.js:25673)
    at Socket.emit (events.js:314)
    at Socket.EventEmitter.emit (domain.js:483)
    at Pipe.<anonymous> (net.js:676)
    t
    m
    • 3
    • 28
  • b

    Bohdan Kolosovsky

    11/30/2020, 12:36 PM
    hi guys, I got some problem dto:
    Copy code
    @Field(() => [Int])
    lengthIds: number[];
    I need to write filter:
    Copy code
    findMany({
    where: {
     length_ids:{
       in: objectDto.filter.lengthIds
    }
    }
    })
    t
    • 2
    • 2
  • b

    Bohdan Kolosovsky

    11/30/2020, 12:36 PM
    and i got this
  • b

    Bohdan Kolosovsky

    11/30/2020, 12:59 PM
    did someone used filter in?
  • j

    John Peña

    12/17/2020, 9:34 PM
    i use webstorm as my editor and whenever i generate my client i have to invalidate my caches and restart webstorm in order to pick up the new files. i think this is because the prisma client is in my node_modules and webstorm doesn’t like to constantly reindex them. anyone experienced this and have a fix?
    j
    • 2
    • 1
  • g

    gkze

    12/30/2020, 10:45 PM
    Hello, newcomer here 👋 Since traversing relations on
    findMany
    is not supported, I am currently doing a nested
    findMany
    (the schema has an m-n relationship between the models) for each object in the results. Is there a better way to achieve this?
    • 1
    • 1
  • c

    Cheese

    01/07/2021, 11:46 PM
    Having an issue with the PrismaClient not being allowed on NextJS...
    r
    • 2
    • 29
  • s

    stephen.pearl

    01/08/2021, 11:22 PM
    Has anyone encountered this issue before: https://prisma.slack.com/archives/CKQTGR6T0/p1610145303450800
    r
    • 2
    • 1
  • c

    Cheese

    01/11/2021, 2:27 PM
    Data isn't showing on the page. I think I've done this correctly.
    Copy code
    export async function getServerSideProps({ params }) {
    const users = await prisma.user.findMany({
      where: { 
        createdAt: new Date(),
        name: params.toString()
      }
    })
    
    return {
      props : { users }
    }
    }
    
    export default function UserPage({users}){
      return (
        <>
          <Head>
          <title>{users.username}</title>
          </Head>
          <Nav />
          <div key={users.id}>
          <h1>{users.username}</h1>
          <p>{users.bio}</p>
          </div>
        </>
      )
    }
    j
    r
    t
    • 4
    • 19
  • c

    Cheese

    01/13/2021, 11:39 PM
    Data still isn't showing. I did however fix the d(...) is not a function by downgrading to next@10.0.4
    Copy code
    TypeError: Cannot read property 'name' of null
    Here's my code snippet:
    Copy code
    export async function getServerSideProps({ params }) {
      const users = await prisma.user.findUnique({
        where: {
          name: params.toString()
        }
      })
    
      return {
        props: { users }
      }
    }
  • c

    Cheese

    01/14/2021, 12:01 AM
    I fixed it!
  • c

    Cheese

    01/14/2021, 12:01 AM
    Changed
    params.toString()
    to
    params.username.toString()
    👍 2
  • t

    Tyler Storm

    01/14/2021, 10:29 PM
    I recently updated from prisma 2.9.0 to 2.14.0 and I am now seeing the following error when using
    findUnique
    Copy code
    app | 2021-01-14 17:15:54 22:15:54.928Z ERROR App-Backend:
    app | 2021-01-14 17:15:54   Query engine exited with code 255
    app | 2021-01-14 17:15:54   PANIC in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tide-0.15.0/src/listener/unix_listener.rs:152:22
    app | 2021-01-14 17:15:54   Could not canonicalize path dir
    app | 2021-01-14 17:15:54   --
    app | 2021-01-14 17:15:54   Error: Query engine exited with code 255
    app | 2021-01-14 17:15:54   PANIC in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tide-0.15.0/src/listener/unix_listener.rs:152:22
    app | 2021-01-14 17:15:54   Could not canonicalize path dir
    app | 2021-01-14 17:15:54       at PrismaClientFetcher.request (/app/backend/node_modules/@prisma/client/runtime/index.js:78136:15)
    app | 2021-01-14 17:15:54       at processTicksAndRejections (internal/process/task_queues.js:97:5)
    Any idea what is happening here? This doesn’t seem to happen to me locally on my macbook but does occur when on my docker deployed to kubernettes
    r
    • 2
    • 1
  • ö

    Ömer Özdemir

    01/22/2021, 12:35 PM
    Prisma client run ok when I use
    ts-node
    but when I try to compile it with
    tsc
    I get this error
    d
    j
    • 3
    • 24
  • m

    Martïn

    01/23/2021, 3:50 PM
    Hey team @Ryan, I have been having issues that I wasn't able to resolve with seeding my DB. Below is my schema and seed code to create 2 actors. I get this message in my console: `Foreign key constraint failed on the field:
    Actor_profileId_fkey (index)
    at PrismaClientFetcher.request (C:\fode\mtchero\node_modules\@prisma\client\runtime\index.js7845515). {`
    code: 'P2003',
    clientVersion: '2.15.0',
    meta: { field_name: 'Actor_profileId_fkey (index)' }
    }
    r
    • 2
    • 5
  • s

    stephen.pearl

    01/26/2021, 3:23 PM
    Is there an example of using
    updateOneEntity
    (where entity is any object) I'm using the crud generated objects and I have no idea what the syntax of the input is.
    ✅ 1
    • 1
    • 1
  • s

    SeekTheError

    02/04/2021, 2:38 PM
    Hi guys, sorry to just barge in with a question like that, but I’m having a strange issue using prisma2 and webpack. Once it’s compiled, at runtime, I get the following error:
    Copy code
    (...) /webpack:/libs/data/src/generated/client/index.js:21
    const debug = debugLib('prisma-client')
                  ^
    TypeError: debugLib is not a function
    The prisma dependencies I have installed in my package.json are:
    Copy code
    "@prisma/client": "2.16",
        "prisma": "^2.16.0",
    and my schema.prisma generator config is:
    Copy code
    generator client {
      provider      = "prisma-client-js"
      output        = "./generated/client"
      previewFeatures = ["nativeTypes"]
      binaryTargets = ["native", "rhel-openssl-1.0.x"]
    }
    Please let me know if I should ask about this somewhere else. Thanks a lot
    👀 1
    j
    • 2
    • 4
  • t

    Tyler Storm

    02/04/2021, 7:37 PM
    Copy code
    Invalid `prisma.user.findMany()` invocation:
    
    
      Can't reach database server at `MY_DB_URL`:`MY_DB_PORT`
    
    Please make sure your database server is running at `MY_DB_URL`:`MY_DB_PORT`.
        at PrismaClientFetcher.request (/Users/tyler/prismaproject/node_modules/@prisma/client/runtime/index.js:78463:15)
        at processTicksAndRejections (internal/process/task_queues.js:94:5)
    Whenever looking up a large quantity of records I get an error saying unable to reach database server. The same query works with less records but seems to be timing out. Found more info on github incase anyone searches the slack here is the link https://github.com/prisma/prisma/issues/4280
    m
    r
    • 3
    • 3
  • y

    Yousuf Hasan

    02/05/2021, 12:09 AM
    What is the best way to save v large nested data currently? 
    createMany
     doesn't support nesting and 
    create
     method gets v slow and has performance issues. I have already raised couple of issues https://github.com/prisma/prisma/issues/5474 and https://github.com/prisma/prisma/issues/5475
  • y

    Yousuf Hasan

    02/05/2021, 3:05 AM
    As per my understanding Prisma performs runtimevalidation when we are trying to create a record is there a way to stop that if we don't want it to perform the validation at runtime?
    r
    • 2
    • 1
  • t

    Tanmay Naik

    02/08/2021, 10:38 AM
    How do I filter with more than one conditions in findMany?
    ✅ 1
    d
    • 2
    • 3
  • u

    李白字一日

    02/09/2021, 10:44 AM
    Copy code
    The change you are trying to make would violate the required relation 'threadTouser' between the `thread` and `user` models.
    ✅ 2
    a
    • 2
    • 7
  • u

    李白字一日

    02/09/2021, 10:44 AM
    how to avoid this?
  • y

    Yousuf Hasan

    02/10/2021, 5:49 AM
    how can i return list of created ids when using createMany(data: {}) ?
    r
    • 2
    • 1
  • t

    Tanmay Naik

    02/10/2021, 1:04 PM
    I want to implement caching queries from prisma postgres into redis, any direction with this would be great help!
    r
    • 2
    • 2
  • c

    Caleb Hyatt

    02/15/2021, 4:22 PM
    Good morning! I'm attempting to use Prisma 2 in Next.js, and I get the following error from Postman when I send a request to my
    /api/createMember
    endpoint.
  • c

    Caleb Hyatt

    02/15/2021, 4:23 PM
    Here is the code I have for the
    createMember
    endpoint:
    t
    • 2
    • 1
  • c

    Caleb Hyatt

    02/15/2021, 4:40 PM
    It seems it's a duplicate of this bug: https://github.com/prisma/prisma/issues/5073
  • t

    Tanmay Naik

    02/16/2021, 7:49 AM
    I have a signup flow where a user with an "owner" role can create a team, the other user values are sent as an array of objects, and a workspace is created with 1-N relationship. How do I run a transactional query for this flow? I currently have a bug where, the owner user and workspace gets created even if there is an error in any of the team users.
    n
    • 2
    • 12
  • j

    Jamey Nakama

    02/16/2021, 6:22 PM
    Is there no way to tell
    seed
    which file to use? It’s a common need to have different seeds, for say local dev, tests, maybe qa, maybe some special case.
    j
    a
    • 3
    • 6
1...678...23Latest