From 185b6f799c35afd8a1de4fb636ecab6cf0d61ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Flod=C3=A9n?= Date: Mon, 6 Jul 2026 12:13:59 +0200 Subject: [PATCH] fix(build): pin turbopack.root, update comment for middleware to proxy rename (#897) Pins turbopack.root to the project directory so a parent-directory lockfile cannot make Turbopack misdetect the workspace root, and updates a stale comment reference (middleware.ts is now proxy.ts). The rename itself already landed on main. --- app/(auth)/auth/callback/route.ts | 2 +- next.config.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/(auth)/auth/callback/route.ts b/app/(auth)/auth/callback/route.ts index 12460320..d06571b3 100644 --- a/app/(auth)/auth/callback/route.ts +++ b/app/(auth)/auth/callback/route.ts @@ -26,7 +26,7 @@ export async function GET(request: NextRequest) { cookiesToSet.forEach((cookie) => { // Mirror the cookie into request.cookies so subsequent getAll() // calls within this request lifecycle return the updated values - // (matches the pattern used in middleware.ts). + // (matches the pattern used in proxy.ts). request.cookies.set(cookie.name, cookie.value) pendingCookies.push(cookie) }) diff --git a/next.config.ts b/next.config.ts index 69e03dca..226f3ad6 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,8 +1,12 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; import type { NextConfig } from "next"; import createNextIntlPlugin from "next-intl/plugin"; const withNextIntl = createNextIntlPlugin("./i18n/request.ts"); +const projectRoot = path.dirname(fileURLToPath(import.meta.url)); + const isDev = process.env.NODE_ENV === "development"; const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL ?? ""; @@ -33,6 +37,11 @@ const cspDirectives = [ const nextConfig: NextConfig = { output: 'standalone', + // Multiple lockfiles exist above this project (e.g. a parent yarn.lock), + // which makes Turbopack infer the wrong workspace root. Pin it explicitly. + turbopack: { + root: projectRoot, + }, async redirects() { return [ {