From 65a1220758c8d737b18e4d591477277cc8747ad1 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 31 May 2026 13:48:21 +0200 Subject: [PATCH] Hotfix: trailingSlash:true so GitHub Pages serves the locale roots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous deploy went live but every visitor hit a 404. Root cause: GitHub Pages serves the URL `/foo/` by looking for `out/foo/index.html`. Next.js's static export with the default `trailingSlash: false` instead emits `out/foo.html`, which Pages only serves for `/foo` (no trailing slash). The i18n root redirect in app/page.tsx points users at `//` (with slash) because that is what next-intl's `` components generate. So every visitor landed on `https://proxmenux.com/en/` → Pages looked for `out/en/index.html`, did not find it (the export had emitted `out/en.html`), and fell back to `out/404.html`. Result: the site looked deployed but every page was a Next.js 404 template. Setting `trailingSlash: true` makes the export emit `out//index.html` for every page — locale roots (`out/en/index.html`, `out/es/index.html`), nested doc pages (`out/en/docs/monitor/dashboard/settings/index.html`, etc.), changelog, guides — so Pages serves them directly. Local verification: 232 pages built, root redirect intact at out/index.html, and every locale + doc + guide URL now resolves to its own index.html. Co-Authored-By: Claude Opus 4.7 --- web/next.config.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/next.config.mjs b/web/next.config.mjs index a0227d65..9ae1cfac 100644 --- a/web/next.config.mjs +++ b/web/next.config.mjs @@ -13,6 +13,18 @@ const withNextIntl = createNextIntlPlugin('./i18n/request.ts') /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", + // GitHub Pages serves a directory URL `/foo/` by looking for + // `out/foo/index.html`. Next.js's default static export with + // `trailingSlash: false` emits `out/foo.html` instead, which Pages + // only serves for the bare URL `/foo` (no trailing slash). The + // i18n root redirect points users at `//` (with + // slash) — so every visitor would land on a 404. Enabling + // trailingSlash makes Next.js emit `out//index.html` for + // every page, including `out/en/index.html` and `out/es/index.html` + // so the locale roots load correctly. Internal `` URLs from + // next-intl already include the trailing slash, so this aligns + // export, runtime navigation and Pages serving. + trailingSlash: true, eslint: { ignoreDuringBuilds: true, },