From 17066b4f6cf3c4a78fd7156c0ecb2a08847e60f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Thu, 9 Apr 2026 12:43:44 +0100 Subject: [PATCH] fix(web): add webpack SVG loader (TURBOPACK=0 prod builds) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit turbopack.rules only applies to turbopack. When building with TURBOPACK=0 (required for Payload CMS), webpack has no SVG rule. Icons.UnitedKingdom returns an object → React #130. Adding a webpack config rule for @svgr/webpack fixes both bundler paths. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web/next.config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index 291eeeb..958aebd 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -102,6 +102,15 @@ const config: NextConfig = { }, }, + // Webpack SVG loader (used when TURBOPACK=0 for production builds) + webpack(config) { + config.module.rules.push({ + test: /\.svg$/, + use: ["@svgr/webpack"], + }); + return config; + }, + images: { remotePatterns: [ {