Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Runtime Error #20490

Closed
EthanHook2 opened this issue Aug 1, 2023 · 9 comments
Closed

Unhandled Runtime Error #20490

EthanHook2 opened this issue Aug 1, 2023 · 9 comments
Labels
5.1.0 bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: Next.js topic: PrismaClient is unable to be run in browser
Milestone

Comments

@EthanHook2
Copy link

EthanHook2 commented Aug 1, 2023

Bug description

Error: PrismaClient is unable to be run in the browser.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues

Heres the contents of lib/prisma.ts
code

How to reproduce

I just refrehed my Next.js app after completing a feature and on every page of my web app im getting this error. the feature I was working on had nothing to do with prisma.

Expected behavior

No response

Prisma information

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

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

model competencys {
  id    Int     @id @default(autoincrement())
  name  String
  users users[] @relation("competencystousers")
}

model groups {
  id    Int     @id @default(autoincrement())
  name  String
  users users[] @relation("groupstousers")
}

model traininggroups {
  id    Int     @id @default(autoincrement())
  name  String
  users users[] @relation("traininggroupstousers")
}

model users {
  id                    Int              @id @default(autoincrement())
  email                 String           @unique(map: "Users_email_key")
  firstName             String
  lastName              String
  password              String
  dateOfBirth           DateTime         @map("date_of_birth")
  discordId             String?
  uses2fa               Boolean?
  gameLiscence          String?
  steamId               String?
  teamspeakId           String?
  accountCraeted        DateTime?
  lastLogin             DateTime?
  ipaddress             String?
  canapplyDate          DateTime?
  acceptanceDate        DateTime?
  loadendDate           DateTime?
  forceNumber           String?
  rank                  String?
  branch                String?
  status                String?          @default("new")
  authCode              String?
  twoFactorCode         String?
  acceptedPrivacyPolicy Boolean          @default(false)
  expirationTime        DateTime?
  competencys           competencys[]    @relation("competencystousers")
  groups                groups[]         @relation("groupstousers")
  traininggroups        traininggroups[] @relation("traininggroupstousers")
}

Environment & setup

  • OS: Windows
  • Database: MySQL,
  • Next.jsv13 latest Canary
  • Node.js version: v20.4.0

Prisma Version

prisma                  : 5.1.0
@prisma/client     : 5.1.0

@EthanHook2 EthanHook2 added the kind/bug A reported bug. label Aug 1, 2023
@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. topic: PrismaClient is unable to be run in browser domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. 5.1.0 labels Aug 2, 2023
@janpio
Copy link
Member

janpio commented Aug 2, 2023

Thanks for the report @EthanHook2. Can you maybe help us with a more complete reproduction? What is the minimal setup we need to experience this problem?

@jharrell
Copy link
Member

jharrell commented Aug 2, 2023

Additionally, could you try our latest dev branch to see if the problem is resolved? Not a long term solution, but will let us know if we’ve already resolved your issue in an upcoming patch.


npm install -D prisma@5.2.0-integration-fix-enums-browser.1
npm install @prisma/client@5.2.0-integration-fix-enums-browser.1
npx prisma generate

@mellson
Copy link

mellson commented Aug 2, 2023

@jharrell this version fixed the problem in our case

@EthanHook2
Copy link
Author

Additionally, could you try our latest dev branch to see if the problem is resolved? Not a long term solution, but will let us know if we’ve already resolved your issue in an upcoming patch.


npm install -D prisma@5.2.0-integration-fix-enums-browser.1
npm install @prisma/client@5.2.0-integration-fix-enums-browser.1
npx prisma generate

I will go update my local branch to see if this fixes the issue, and get back to you. Thank you

@EthanHook2
Copy link
Author

From updating to that new dev version, its working a charm now my Next.jsv13 web app. Thank you

@AndreiOvercode
Copy link

Additionally, could you try our latest dev branch to see if the problem is resolved? Not a long term solution, but will let us know if we’ve already resolved your issue in an upcoming patch.


npm install -D prisma@5.2.0-integration-fix-enums-browser.1
npm install @prisma/client@5.2.0-integration-fix-enums-browser.1
npx prisma generate

I had the same problem and this solved it

@felixmokross
Copy link

I had a similar issue with the latest Prisma version (just upgraded from 4.x) in a Remix app.
In my case I got the following error in the browser:

Uncaught TypeError: Cannot set properties of undefined (setting 'AccountType')
    at node_modules/.prisma/client/index-browser.js (index-browser.js:204:38)
…

exports.$Enums is not defined in index-browser.js:

image

With the suggested dev branch package it works.

@janpio janpio added this to the 5.2.0 milestone Aug 2, 2023
@janpio
Copy link
Member

janpio commented Aug 2, 2023

Thanks for your feedback, we will release this fix as 5.1.1 tomorrow. Stay tuned.

@janpio janpio closed this as completed Aug 2, 2023
@janpio janpio reopened this Aug 2, 2023
@Jolg42
Copy link
Member

Jolg42 commented Aug 2, 2023

I think we can close this as a duplicate of #20480
And we'll let you know tomorrow when the patch is out 🙌🏼

@Jolg42 Jolg42 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.1.0 bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: Next.js topic: PrismaClient is unable to be run in browser
Projects
None yet
Development

No branches or pull requests

7 participants