Repository navigation
|
Hi. We are using ES5 target on a nextjs project to work around some Safari bugs (and nextjs forces you to use the same target for backend and frontend) But we also want to migrate that project from prisma6+binaryTargets to prisma7+adapter-pg Is it wise to migrate to prisma7+adapter-pg (which I assume is all JS code?) and still push the ES5 target? backend code runs on latest nodejs, that only impacts the generated code from our .ts build step. So i am assume it should be safe, right? Or does prisma generate step is affected somehow by our tsconfig? |
Replies: 2 comments 1 reply
|
Short answer: the ES5 target shouldn't matter for Prisma 7 at runtime, but it can trip the type-check, and it probably isn't the setting that fixes your Safari issue anyway. Runtime. Prisma Client + Where ES5 can bite: type-checking. The v7 If it's clean, you're fine. If it isn't, see the last section. Does For the Safari bugs. Next.js compiles your code with SWC, and browser support is controlled by Browserslist in |
|
I ran the check that was left open above, since "does the generated client survive Setup:
So: the generated code is fine at ES5. The only thing that bites is a Two things your tsconfig target does not affect, which is why it is otherwise harmless here:
On the Safari side, +1 to the previous reply: Next.js compiles browser output from Browserslist, not from tsconfig |
I ran the check that was left open above, since "does the generated client survive
target: ES5" is the whole question.Setup:
prisma@7.10.1,@prisma/client@7.10.1,@prisma/adapter-pg@7.10.1, TypeScript 5.9.3,prisma-clientgenerator (emits.tsintogenerated/prisma), one model with aBigIntand aString[]column, and a Next.js-style tsconfig:"target": "ES5","lib": ["dom", "dom.iterable", "esnext"],strict,isolatedModules,moduleResolution: bundler. Thentsc --noEmiton my code plus the generated files.target: ES5,skipLibCheck: true(the Next.js default): clean. Same result withES2017.target: ES5,skipLibCheck: false: fails, 4 errors, allTS18028: Private identifiers are only avail…