From 4370a80ae705f8ce0f0c094ea52eeadceb054b66 Mon Sep 17 00:00:00 2001 From: Puechberty Arthur Date: Mon, 27 Apr 2026 22:23:43 +0200 Subject: [PATCH] Set turbopack.root to the monorepo root in next.config.mjs to resolve the Next.js Turbopack workspace root error. --- apps/web/next.config.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 09adbcc..eb124aa 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,5 +1,10 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + import createNextIntlPlugin from "next-intl/plugin"; +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + const withNextIntl = createNextIntlPlugin("./i18n/request.ts"); /** @type {import('next').NextConfig} */ @@ -12,6 +17,10 @@ const nextConfig = { // IMPORTANT pour éviter les problèmes de paths en monorepo outputFileTracingRoot: process.cwd(), + turbopack: { + root: path.join(__dirname, "..", ".."), + }, + // optimise build (optionnel mais recommandé) poweredByHeader: false, compress: true,