From 9cdf7b078633f1bd6f3c7247e19090a55fe6f8f7 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 3 Nov 2025 21:34:12 +0100 Subject: [PATCH] Fix build error: Force dynamic rendering for calculator page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The calculator page was failing during build because useSearchParams() requires a request context and cannot be used during static site generation. Added 'export const dynamic = force-dynamic' to force dynamic rendering, which allows useSearchParams() to work correctly for QR code parameter detection. This fixes the build error: "Error occurred prerendering page "/calculator"" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/calculator/page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/calculator/page.tsx b/app/calculator/page.tsx index 7007917..3f5adac 100644 --- a/app/calculator/page.tsx +++ b/app/calculator/page.tsx @@ -1,6 +1,9 @@ import type { Metadata } from 'next'; import { CalculatorClient } from '../../components/CalculatorClient'; +// Force dynamic rendering since we need to read URL search parameters +export const dynamic = 'force-dynamic'; + export const metadata: Metadata = { title: 'Carbon Calculator', description: 'Calculate your yacht\'s carbon footprint and purchase verified carbon offsets. Enter fuel usage or nautical miles to get accurate CO2 emissions calculations and offset options.',