From 692d1fdf57aa9e54f6ee681c4bb55821e34dd12d Mon Sep 17 00:00:00 2001 From: Muhammad Ridwan Ramadhan <34785758+ridwanramadhan@users.noreply.github.com> Date: Wed, 13 May 2026 15:35:44 +0700 Subject: [PATCH] fix(docker): restore /app/server.js in standalone build (#1064) (#1067) Set outputFileTracingRoot back to projectRoot. In Docker, the parent (monorepoRoot) was /, which caused Next.js to emit server.js at .next/standalone/app/server.js and pull in /usr, /root, /proc paths, breaking from /app. Fixes #1064 Co-authored-by: Muhammad Ridwan Ramadhan --- next.config.mjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index daa4e17..de5874f 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,8 +1,7 @@ import { fileURLToPath } from "node:url"; -import { dirname, resolve } from "node:path"; +import { dirname } from "node:path"; const projectRoot = dirname(fileURLToPath(import.meta.url)); -const monorepoRoot = resolve(projectRoot, ".."); /** @type {import('next').NextConfig} */ const nextConfig = { @@ -11,9 +10,9 @@ const nextConfig = { turbopack: { root: projectRoot }, - outputFileTracingRoot: monorepoRoot, + outputFileTracingRoot: projectRoot, outputFileTracingExcludes: { - "*": ["./app/gitbook/**/*", "./gitbook/**/*"] + "*": ["./gitbook/**/*"] }, images: { unoptimized: true