prisma: `prisma-client`: TypeError: __banner_node_url when using enums on the client-side
Bug description
I upgraded to prisma 6.6.0 and getting this error randomly this morning in my browser. This is specific to 6.6.0 and going back to 6.5.0 is fine again.
I’m using Bun with a turbo monorepo with Tanstack Start
generator client {
provider = "prisma-client" // no `-js` at the end
output = "./generated/prisma" // `output` is required
moduleFormat = "esm" // or `"cjs"` for CommonJS
}
browser error:
@prisma_client_runtime_library.js?v=16686fa7:135 Uncaught (in promise) TypeError: __banner_node_url.
Severity
⚠️ Major: Breaks core functionality (e.g., migrations fail)
Reproduction
upgraded from 6.5.0 and applied the new generator
Expected vs. Actual Behavior
expected to see new 6.6.0 behavior
Frequency
Consistently reproducible
Does this occur in development or production?
Both development and production
Is this a regression?
“Yes, last worked in Prisma 6.5.0, broke in 6.6.0”
Workaround
“Downgrading to Prisma 6.5.0 fixes it”
Prisma Schema & Queries
generator client {
provider = "prisma-client" // no `-js` at the end
output = "./generated/prisma" // `output` is required
moduleFormat = "esm" // or `"cjs"` for CommonJS
}
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 14
- Comments: 20 (6 by maintainers)
Are you folks trying to import the types into frontend code which has no knowledge of node specific things like file access? 🤔
If you are barely interested in the types of certain objects and enums you can starting with Prisma 6.7.0 and the new generator import directly from a specific model file. E.g.
import { type UserModel } from '~/generated/prisma/models/User';.Does this help?
Same here, I made the mistake of adding an enum, then removed all traces and I am back with this error. I see the generated
enum.tsfile but there is not really anything to import because the enum is not used.well I’m doubly confused now… I got rid of all my enum imports (client and server side) and updated to 6.7 with esm and still getting the same error
Also have this issue using monorepo, yarn with React Router version 7, framework mode. Especially when trying to import an enum into client side code.
I am seeing a similar error after updating to 6.6.0.
Browsers error:
My issue here was that I was including prima code in my client bundle. I specifically had some constants exported from a file that was handling my database interactions. I moved the constants into a different file that I then import from and then these errors went away. vite complained about
node:urlbeing included in the client bundle which sent me down the path to find this. I’m usingreact-routerv7 withvite.historically I’ve had a lot of bizarre issues with Prisma when using the enums in the frontend for types… I’m assuming UserRole is an enum in your example? I have lots of enums in my Prisma project that I use in my frontend code.
As you all seem to use the new
prisma-clientgenerator that is in early access: In the upcoming 6.7.0 we introduce a file splitting for the new generator that will make all user defined enums available in a dedicated file. You can then import this single fileenums.tsfile from the generated output.The currently generated output in 6.6.0 in the new generator is not suitable to be used in browser environments as is.