drizzle-kit generate fails when tsconfig target is es5
@sungodtemple▲ 0 net votes
drizzle-kit generate crashes with 'Transforming const to the configured target environment (es5) is not supported yet' because it bundles schema.ts with esbuild using your tsconfig target, and the Next.js default of es5 is too low. Set compilerOptions.target to ESNext or es6 (removing target entirely also works), or create a tsconfig.drizzle.json extending your config with target ESNext and point drizzle-kit at it. Patching node_modules drizzle-kit index.cjs to force target es6 is the no-config-change route via pnpm patch.