Skip to content

Commit ca27adc

Browse files
waleedlatif1claude
andcommitted
fix(landing): return 404 for invalid dynamic route slugs
Add `dynamicParams = false` to all landing page dynamic routes so Next.js returns a proper 404 instead of a client-side exception for slugs not in generateStaticParams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 60c836d commit ca27adc

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

apps/sim/app/(landing)/blog/[slug]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { getBaseUrl } from '@/lib/core/utils/urls'
99
import { BackLink } from '@/app/(landing)/blog/[slug]/back-link'
1010
import { ShareButton } from '@/app/(landing)/blog/[slug]/share-button'
1111

12+
export const dynamicParams = false
13+
1214
export async function generateStaticParams() {
1315
const posts = await getAllPostMeta()
1416
return posts.map((p) => ({ slug: p.slug }))

apps/sim/app/(landing)/integrations/[slug]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const baseUrl = SITE_URL
2020
const bySlug = new Map(allIntegrations.map((i) => [i.slug, i]))
2121
const byType = new Map(allIntegrations.map((i) => [i.type, i]))
2222

23+
export const dynamicParams = false
24+
2325
/**
2426
* Returns up to `limit` related integration slugs.
2527
*

apps/sim/app/(landing)/models/[provider]/[model]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020

2121
const baseUrl = SITE_URL
2222

23+
export const dynamicParams = false
24+
2325
export async function generateStaticParams() {
2426
return ALL_CATALOG_MODELS.map((model) => ({
2527
provider: model.providerSlug,

apps/sim/app/(landing)/models/[provider]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import {
2222

2323
const baseUrl = SITE_URL
2424

25+
export const dynamicParams = false
26+
2527
export async function generateStaticParams() {
2628
return MODEL_PROVIDERS_WITH_CATALOGS.map((provider) => ({
2729
provider: provider.slug,

0 commit comments

Comments
 (0)