From 253e0ac43c3a8e69df3dc172bc8d6c6ae7fcc42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:41:38 +0100 Subject: [PATCH] fix(web): turbopack config dev-only (prod build compat) Next.js 16.0.10 fails production builds with turbopack config present (needs >=16.1.0). Gate it behind NODE_ENV !== production. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/next.config.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index 375f046..196300e 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -82,14 +82,21 @@ const config: NextConfig = { "better-sqlite3", "@mapbox/node-pre-gyp", ], - turbopack: { - rules: { - "*.svg": { - loaders: ["@svgr/webpack"], - as: "*.js", - }, - }, - }, + // turbopack config moved to dev-only — Next.js 16.0.10 doesn't + // support turbopack for production builds (needs >=16.1.0). + // SVG loading via @svgr/webpack works via the webpack config below. + ...(process.env.NODE_ENV !== "production" + ? { + turbopack: { + rules: { + "*.svg": { + loaders: ["@svgr/webpack"], + as: "*.js", + }, + }, + }, + } + : {}), images: { remotePatterns: [