Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing V2 Index with Layout conflict error. #5586

Closed
1 task done
UltraWelfare opened this issue Feb 27, 2023 · 2 comments
Closed
1 task done

Routing V2 Index with Layout conflict error. #5586

UltraWelfare opened this issue Feb 27, 2023 · 2 comments

Comments

@UltraWelfare
Copy link

UltraWelfare commented Feb 27, 2023

What version of Remix are you using?

1.13.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. npx create-remix@latest --template remix-run/indie-stack

  2. Create a folder questions/ for the layout that should have the Outlet inside

export default function QuestionsLayout() {
  return (
    <div className="flex h-full min-h-screen flex-col">
      <h1>Questions</h1>
      <main>
        <div className="flex-1 p-6">
          <Outlet/>
        </div>
      </main>
    </div>
  );
}
  1. Create a questions._index/ for the actual index route.
export default function QuestionIndex() {
  return (
    <div>
      Index
    </div>
  );
}

This is how it should look like:
image

Expected Behavior

According to the V2 docs here section Folders for Organization I can see essentially the same thing:
image

When navigating to /questions it should load the questions/route.tsx as a layout and then questions._index/route.tsx as i'm in the index path.

Actual Behavior

Remix throws a conflict error.

Error: Path "/questions" defined by route "questions._index/route" conflicts with route "questions/route"

@UltraWelfare
Copy link
Author

Might be related to #5216 but this one uses index instead of route for filenames. I don't know if this internally affects anything.

@UltraWelfare
Copy link
Author

As per @mcansh who answered on a discord help topic the issue is fixed by #5459.

I'm closing this issue.

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

No branches or pull requests

1 participant