You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prisma generate (and prisma -v) crashes with ERR_REQUIRE_ESM on Prisma 7.10.0. The crash happens in @prisma/dev's state.cjs, which does a top-level require("zeptomatch") — an ESM-only package ("type": "module", no CJS exports condition). This reproduces regardless of Node version or generator block configuration, so it does not match the "only occurs on Node < 22" explanation given in #28784 / fixed by #28807.
Reproduction
node_modules/prisma/build/index.js generate
Crashes identically whether invoked via bun add -d prisma@7.10.0 (which runs the postinstall: prisma generate script), via bunx prisma generate, or via direct node node_modules/prisma/build/index.js generate — ruling out a Bun-specific invocation issue.
Tried and confirmed not to fix it:
Upgrading Node.js to 22.18.0 and to 24.21.0 (via fnm), both freshly installed — identical crash. This directly contradicts the maintainer comment on Error [ERR_REQUIRE_ESM]: require() of ES Module #28784 that this "only occurs when using an out of date and below system requirements version of Node.js".
Pinning zeptomatch via overrides/resolutions in package.json to every published version (1.0.0 → 2.1.0, the latest) — every version is ESM-only, so there is no CJS-compatible version to pin.
Switching the generator client block from prisma-client-js to the new prisma-client generator, in every combination of its options:
The crash happens during the CLI's own bootstrap (loading @prisma/dev) before the schema/generator block is even parsed, so no generator configuration can avoid it.
Expected vs. Actual Behavior
Expected:prisma generate runs successfully with prisma@7.10.0 on Node 20/22/24 and under Bun.
Actual:
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/zeptomatch/dist/index.js from /path/to/node_modules/@prisma/dev/dist/state.cjs not supported.
Instead change the require of index.js in /path/to/node_modules/@prisma/dev/dist/state.cjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/path/to/node_modules/@prisma/dev/dist/state.cjs:1:2235) {
code: 'ERR_REQUIRE_ESM'
}
Environment
prisma: 7.10.0
OS: Ubuntu 24.04.4 LTS on WSL2 (6.6.87.2-microsoft-standard-WSL2)
Bug description
prisma generate(andprisma -v) crashes withERR_REQUIRE_ESMon Prisma 7.10.0. The crash happens in@prisma/dev'sstate.cjs, which does a top-levelrequire("zeptomatch")— an ESM-only package ("type": "module", no CJSexportscondition). This reproduces regardless of Node version orgeneratorblock configuration, so it does not match the "only occurs on Node < 22" explanation given in #28784 / fixed by #28807.Reproduction
Crashes identically whether invoked via
bun add -d prisma@7.10.0(which runs thepostinstall: prisma generatescript), viabunx prisma generate, or via directnode node_modules/prisma/build/index.js generate— ruling out a Bun-specific invocation issue.Tried and confirmed not to fix it:
fnm), both freshly installed — identical crash. This directly contradicts the maintainer comment on Error [ERR_REQUIRE_ESM]: require() of ES Module #28784 that this "only occurs when using an out of date and below system requirements version of Node.js".zeptomatchviaoverrides/resolutionsinpackage.jsonto every published version (1.0.0 → 2.1.0, the latest) — every version is ESM-only, so there is no CJS-compatible version to pin.generator clientblock fromprisma-client-jsto the newprisma-clientgenerator, in every combination of its options:@prisma/dev) before the schema/generator block is even parsed, so no generator configuration can avoid it.Expected vs. Actual Behavior
Expected:
prisma generateruns successfully withprisma@7.10.0on Node 20/22/24 and under Bun.Actual:
Environment
prisma: 7.10.06.6.87.2-microsoft-standard-WSL2)fnm)fnm)bun.lock)Related
@prisma/devinInit.ts" — this only lazy-loads it forprisma init, but the crash here happens on plainprisma generate, so it isn't covered by that fix.Happy to provide a minimal reproduction repo if useful.