Skip to content

Conversation

@MenKNas
Copy link
Contributor

@MenKNas MenKNas commented Jan 26, 2026

Description / Motivation

Fix route handler static generation error

Fixed an issue where Next.js was attempting to statically generate route handlers that use request.headers, causing build failures with the error "Route couldn't be rendered statically because it used request.headers".

Solution:
Added export const dynamic = 'force-dynamic' to all route handlers that access request headers, cookies, or draftMode. This explicitly marks them as dynamic routes that must be rendered at request time.

Affected routes:

  • Sitemap route handler
  • Robots route handler
  • Editing config route handler
  • Editing render route handler

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@MenKNas MenKNas self-assigned this Jan 26, 2026
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

📦 Package Size and Test Coverage Report

Package Base Size PR Size Δ Change Base Coverage PR Coverage Δ Change
analytics-core 122.52 KB 122.52 KB ✅ 0.00 KB 100.00% 100.00% 0.00%
cli 58.68 KB 58.68 KB ✅ 0.00 KB 69.73% 69.73% 0.00%
core 505.17 KB 505.17 KB ✅ 0.00 KB 91.23% 91.23% 0.00%
create-content-sdk-app 243.34 KB 243.64 KB 🔺 +0.30 KB 96.22% 96.22% 0.00%
events 76.91 KB 76.91 KB ✅ 0.00 KB 98.40% 98.40% 0.00%
nextjs 427.50 KB 427.50 KB ✅ 0.00 KB 89.73% 89.73% 0.00%
personalize 63.45 KB 63.45 KB ✅ 0.00 KB 99.32% 99.32% 0.00%
react 289.13 KB 289.13 KB ✅ 0.00 KB 93.64% 93.64% 0.00%
search 6.40 KB 6.40 KB ✅ 0.00 KB 98.57% 98.57% 0.00%
Total 🔺 +0.30 KB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants