Fix integration detail page 404 from route shadowing#8103
Conversation
ENG-564 (#7687) added `pages/integrations/[id]/edit-dataset.tsx`, creating a `[id]/` directory that shadows the existing `[id].tsx` dynamic route. Next.js resolves the directory over the file, but since there's no `index.tsx` inside, all `/integrations/<key>` routes return 404. Move `[id].tsx` into `[id]/index.tsx` so both routes coexist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/code-review |
There was a problem hiding this comment.
Code Review: PR #8103 — Fix integration detail route
Summary: This is a minimal, surgical fix. The change renames clients/admin-ui/src/pages/integrations/[id].tsx → clients/admin-ui/src/pages/integrations/[id]/index.tsx. No code is modified — it's a pure file move.
What the fix does
Next.js uses file-based routing. When ENG-564 added a nested route directory (e.g. integrations/[id]/some-child-route/), it created a conflict: Next.js cannot have both a [id].tsx file and a [id]/ directory at the same level — the directory wins, causing the [id].tsx page to effectively shadow out and return 404. Converting the file to [id]/index.tsx resolves the conflict while preserving the exact same URL (/integrations/:id).
Review findings
Correctness: The fix is correct. This is the standard Next.js pattern for converting a page file to a layout-compatible index route when a sibling directory with the same name is needed.
No logic changes: File content is 100% identical (similarity index 100%), so no functional regression is possible.
Changelog: A changelog entry is included and accurately describes the fix.
No concerns: No issues found. The change is minimal, well-scoped, and solves the reported 404 correctly.
🔬 Codegraph: connected (48932 nodes)
💡 Write /code-review in a comment to re-run this review.
lucanovera
left a comment
There was a problem hiding this comment.
I couldn't reproduce the original issue, but this is the correct way of organizing the files and it loads correctly after clearing the next.js cache. approved.
Summary
pages/integrations/[id]/edit-dataset.tsx, which created a[id]/directory alongside the existing[id].tsxdynamic route[id]/directory shadows[id].tsx[id]/has noindex.tsx, all/integrations/<key>URLs (e.g./integrations/testjirae2e) return a 404:[id].tsx→[id]/index.tsxso the detail page and nested routes (edit-dataset) coexist correctlyTest plan
/integrations/<key>) — should load instead of 404/integrations/<key>/edit-dataset— should still work/integrations) — unaffected🤖 Generated with Claude Code