From 5edfb27ff8c4e613052ca9a85d414cf682908e88 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 18:46:54 +0000 Subject: [PATCH] fix: remove "type": "module" from backend package.json to fix Vercel ESM error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- apps/backend/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/backend/package.json b/apps/backend/package.json index 4b8c467eb..e1479f108 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -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",