Set turbopack.root to the monorepo root in next.config.mjs to resolve the Next.js Turbopack workspace root error.

This commit is contained in:
Puechberty Arthur
2026-04-27 22:23:43 +02:00
parent d66056d031
commit 4370a80ae7
+9
View File
@@ -1,5 +1,10 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import createNextIntlPlugin from "next-intl/plugin"; import createNextIntlPlugin from "next-intl/plugin";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const withNextIntl = createNextIntlPlugin("./i18n/request.ts"); const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
@@ -12,6 +17,10 @@ const nextConfig = {
// IMPORTANT pour éviter les problèmes de paths en monorepo // IMPORTANT pour éviter les problèmes de paths en monorepo
outputFileTracingRoot: process.cwd(), outputFileTracingRoot: process.cwd(),
turbopack: {
root: path.join(__dirname, "..", ".."),
},
// optimise build (optionnel mais recommandé) // optimise build (optionnel mais recommandé)
poweredByHeader: false, poweredByHeader: false,
compress: true, compress: true,