Skip to content

fix(landing): return 404 for invalid dynamic route slugs#4182

Merged
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/fix-integrations-404
Apr 15, 2026
Merged

fix(landing): return 404 for invalid dynamic route slugs#4182
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/fix-integrations-404

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add dynamicParams = false to all landing page dynamic routes (integrations, models, blog)
  • Invalid slugs now show the custom 404 page instead of a client-side exception

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

TheodoreSpeaks and others added 2 commits April 15, 2026 11:33
* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
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>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 15, 2026 6:42pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 15, 2026

PR Summary

Low Risk
Low risk: a config-only change that restricts dynamic routes to generateStaticParams output, affecting routing/404 behavior but not core business logic or data handling.

Overview
Landing dynamic routes now reject unknown slugs. Adds export const dynamicParams = false to the blog post, integration, and model provider/model pages so only slugs returned by generateStaticParams are valid.

This makes invalid /blog/[slug], /integrations/[slug], and /models/[provider]/[model] (and /models/[provider]) URLs return the app’s 404 page rather than attempting to render and throwing client/runtime errors.

Reviewed by Cursor Bugbot for commit 33c29cc. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/home/home.tsx Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 15, 2026

Greptile Summary

Adds export const dynamicParams = false to all four landing page dynamic routes (blog, integrations, provider, and model detail). With this export, Next.js returns a 404 for any slug not emitted by generateStaticParams instead of attempting to render the page and throwing a client-side exception.

Confidence Score: 5/5

Safe to merge — minimal, targeted change that applies the standard Next.js pattern for 404-on-unknown-slugs across all landing dynamic routes.

All four files receive only the single-line export const dynamicParams = false addition, which is the idiomatic Next.js mechanism for this use case. Each route already had a correct generateStaticParams implementation, so the new export slots in without any other changes needed. No logic, state, or data-fetching is affected.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/(landing)/blog/[slug]/page.tsx Added dynamicParams = false to statically gate blog post slugs; correct and consistent with the existing generateStaticParams + revalidate setup.
apps/sim/app/(landing)/integrations/[slug]/page.tsx Added dynamicParams = false; the existing notFound() guard inside the render function is now unreachable but harmless defensive code.
apps/sim/app/(landing)/models/[provider]/[model]/page.tsx Added dynamicParams = false to the model detail route; pairs correctly with generateStaticParams iterating ALL_CATALOG_MODELS.
apps/sim/app/(landing)/models/[provider]/page.tsx Added dynamicParams = false to the provider listing route; pairs correctly with generateStaticParams iterating MODEL_PROVIDERS_WITH_CATALOGS.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming Request\nfor dynamic slug] --> B{slug in\ngenerateStaticParams?}
    B -- Yes --> C[Render static page\n/ revalidate if stale]
    B -- No --> D[dynamicParams = false\nNext.js returns 404]
    D --> E[Custom 404 page shown]
    C --> F[Page rendered successfully]
Loading

Reviews (2): Last reviewed commit: "fix(home): remove duplicate handleStopGe..." | Re-trigger Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/home/home.tsx Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 33c29cc. Configure here.

@waleedlatif1 waleedlatif1 merged commit 0b36c8b into staging Apr 15, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fix-integrations-404 branch April 15, 2026 18:48
Sg312 added a commit that referenced this pull request Apr 15, 2026
…mat, logs performance improvements

fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179)
fix(landing): return 404 for invalid dynamic route slugs (#4182)
improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170)
fix(gemini): support structured output with tools on Gemini 3 models (#4184)
feat(brightdata): add Bright Data integration with 8 tools (#4183)
fix(mothership): fix superagent credentials (#4185)
fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
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