fix: remove "type": "module" from backend package.json to fix Vercel ESM error

Next.js 16.2 has a known regression (vercel/next.js#91661) where the
.next/package.json CJS boundary marker is not included in the Vercel
serverless function bundle. This causes Node.js to walk up to the
project's package.json, see "type": "module", and treat the compiled
server bundles as ESM — breaking the require() calls in the generated
route files.

The fix (vercel/next.js#93612) is only in canary (16.3.0-canary.17+),
not yet in a stable release. Removing "type": "module" is safe here
because:
- All backend source is TypeScript (no .js files)
- next.config is .mjs (explicit ESM)
- .eslintrc is .cjs (explicit CJS)
- Scripts use tsx (handles ESM regardless)
- TypeScript's moduleResolution: bundler is independent of this field

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
Devin AI 2026-05-20 18:46:54 +00:00
parent 2e1a0d76e5
commit 5edfb27ff8

View File

@ -3,7 +3,6 @@
"version": "2.8.90",
"repository": "https://github.com/hexclave/stack-auth",
"private": true,
"type": "module",
"scripts": {
"clean": "rimraf src/generated && rimraf .next && rimraf node_modules",
"typecheck": "tsc --noEmit",