fix: resolve brand brief routing conflict (/briefs/new → /brand/briefs/new)#13
Merged
fix: resolve brand brief routing conflict (/briefs/new → /brand/briefs/new)#13
Conversation
app/(agency)/briefs/[id] and app/(brand)/briefs/new both resolved to /briefs/new. Next.js served the agency dynamic route with id="new", which immediately called notFound(). The brand Submit Brief form was never rendered. Fix: move the brand page to app/(brand)/brand/briefs/new/page.tsx so it serves at /brand/briefs/new — a URL with no overlap with any agency route. Update Sidebar and RoleSwitcher to use the new URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app/(agency)/briefs/[id]andapp/(brand)/briefs/newboth resolved to the URL/briefs/newid="new", which immediately callednotFound()since no brief has that IDRoot cause
Next.js App Router route groups are purely organizational. Two pages in different route groups can collide at the same URL. Since the agency has
briefs/[id](dynamic) and the brand hadbriefs/new(static), they overlap at/briefs/new. In practice Next.js resolved to the agency route first.Fix
app/(brand)/briefs/new/page.tsx→app/(brand)/brand/briefs/new/page.tsx(URL:/brand/briefs/new)Sidebar.tsx: brand_manager Submit Brief href →/brand/briefs/newRoleSwitcher.tsx: brand_manager home route →/brand/briefs/newTest plan
/brand/briefs/new(not 404)/brand/briefs/newand renders the form/briefs/brief_001still works and shows the agency brief detail (not the brand form)🤖 Generated with Claude Code