PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87
See original GitHub issueHi Prisma Team! My Prisma Client just crashed. This is the report: This happened after I added the nApi previewFeature. I’m also using a PaaS to deploy. I have no info about their server config. I had no issues on own PC.
Versions
Name | Version |
---|---|
Node | v14.15.0 |
OS | debian-openssl-1.1.x |
Prisma Client | 2.26.0 |
Query Engine | 0.1.0 |
Database | mysql |
Query
{"X":{}}
Logs
at LibraryEngine.logger (/app/node_modules/@prisma/client/runtime/index.js:22751:32)
at /app/node_modules/@prisma/client/runtime/index.js:22721:36
prisma:client:napi sending request, this.libraryStarted: true
prisma:client:napi library already starting, this.libraryStarted: true
prisma:client:napi graphQLToJSError
prisma:client:fetcher Error: called `Option::unwrap()` on a `None` value
at LibraryEngine.prismaGraphQLToJSError (/app/node_modules/@prisma/client/runtime/index.js:22870:14)
at LibraryEngine.request (/app/node_modules/@prisma/client/runtime/index.js:22885:24)
at async cb (/app/node_modules/@prisma/client/runtime/index.js:33866:26)
at async Object.exports.updateUser (/app/modules/users/model.js:51:20)
at async exports.updateUser (/app/modules/users/controller.js:44:20)
Client Snippet
const user = await db.user.findFirst({
where: {
deleted: {
equals: false,
},
OR: [
{
email: {
equals: email,
},
},
{
username: {
equals: email,
},
},
],
},
select: {
id: true,
avatar: true,
username: true,
email: true,
password: true,
profile_completed: true,
profession: true,
email_verified: true,
bio: true,
social_media: true,
header_img: true,
full_name: true,
},
});
Schema
model User {
id Int @id @default(autoincrement())
username String @unique @db.VarChar(255)
email String @unique @db.VarChar(255)
password String @db.VarChar(255)
created_at DateTime @default(now()) @db.DateTime(6)
updated_at DateTime @updatedAt
deleted Boolean @default(false)
type Roles @default(USER)
avatar String? @db.VarChar(250)
header_img String? @db.VarChar(250)
bio String? @db.Text
full_name String? @db.VarChar(250)
posts Post[] @relation(name: "posts")
likes Likes[] @relation(name: "userLikes")
bookmarks Bookmarks[] @relation(name: "userBookmarks")
comments Comments[]
commentLikes commentLikes[]
commentReplies commentReplies[]
pollVotes PollVotes[]
verified Boolean @default(false)
email_verified Boolean @default(false)
profile_completed Boolean @default(false)
social_media Json?
@@index([email, username])
@@map("users")
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
called `Option::unwrap()` on a `None` value in query-engine ...
Hi Prisma Team! My Prisma Client just crashed. It looks like this is a critical bug because after it happens, no more query...
Read more >Panicked at 'called `Option::unwrap()` on a `None` value ...
Hi! I'm currently porting the Lox language from Crafting Interpreters , but I've been stuck for a while in an annoying bug.
Read more >stylo: panicked at 'called `Option::unwrap()` on a `None` value'
Example bugs: toggling class name on an element does not restyle the element; background-color property does not support hsl() values. Specifications covered:.
Read more >rust - Code within try block still panics when calling unwrap on ...
My understanding is that if the .unwrap is called on a None value, the try block will return a Result::Err.
Read more >FAQ: Why is this user counted under '(none)' or an unexpected ...
... called (none) . In Amplitude, (none) represents a null value. But why do some of your users have null event or user...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you maybe open a new issue about this and provide all the information it asks for? Optimal would be some code for us to easily reproduce the error. Assume we don’t know much about how to use nodemon or how it works. Super eager to look into this!
I will close this for as I can’t reproduce this NAPI as well with 2.28. Please let us know if this happens again.
Hosting platform shouldn’t matter here.