From e879016879139560ded9a2383add119299e47b6e Mon Sep 17 00:00:00 2001 From: DavidHerran Date: Mon, 4 May 2026 16:53:20 -0500 Subject: [PATCH] fix: pass locale explicitly to next-intl helpers (DYNAMIC_SERVER_USAGE) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Production logs were spamming "DYNAMIC_SERVER_USAGE" errors and every ISR-cached page (home, news, heritage, applications, news/[slug]) was 500-ing. Root cause: when force-dynamic was replaced with revalidate=60 last commit batch, the implicit locale-resolution path through next-intl's getTranslations() / getLocale() / getMessages() became a problem. Without an explicit locale arg, next-intl reads cookies() under the hood — which trips Next.js's "dynamic API used inside a static / ISR render" guard and aborts with DYNAMIC_SERVER_USAGE. Fix: pass the locale (already known from the URL via params) every time we call next-intl on the server. CHANGES - src/components/layout/Footer.tsx - Now accepts `locale` as a prop instead of awaiting getLocale() - getTranslations({ locale, namespace: "Footer" }) - src/app/[locale]/layout.tsx - Passes locale prop to