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

Layout can't be located in folder with routing v2 #5261

Closed
1 task done
ziimakc opened this issue Jan 25, 2023 · 3 comments · Fixed by #5228
Closed
1 task done

Layout can't be located in folder with routing v2 #5261

ziimakc opened this issue Jan 25, 2023 · 3 comments · Fixed by #5228
Assignees

Comments

@ziimakc
Copy link

ziimakc commented Jan 25, 2023

What version of Remix are you using?

1.11.1

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

  • Yes

Steps to Reproduce

npx create-remix@latest

Switch to V2 routing, and run remix routes

Expected Behavior

Following layout should work no matter if files or the same folders with index.tsx inside are used:

user.$id/index.tsx - user layout
user.$id._index/index.tsx - nested in user layout

    <Route path="user/:id" file="routes/user.$id.tsx">
      <Route index file="routes/user.$id._index.tsx" />>
    </Route>

Actual Behavior

Works:

user.$id.tsx - user layout
user.$id._index.tsx - nested in user layout

    <Route path="user/:id" file="routes/user.$id.tsx">
      <Route index file="routes/user.$id._index.tsx" />>
    </Route>

Doesn't:

user.$id/index.tsx - user layout
user.$id._index/index.tsx - nested in user layout

Error: Path "/user/:id" defined by route "user.$id._index/index" conflicts with route "user.$id/index"

@ziimakc ziimakc changed the title Nested layout works as file, but not as folder with the same name and index file inside Layout can't be located in folder with index with routing v2 Jan 26, 2023
@ziimakc ziimakc changed the title Layout can't be located in folder with index with routing v2 Layout can't be located in folder with routing v2 Jan 26, 2023
@ziimakc
Copy link
Author

ziimakc commented Jan 26, 2023

After some testing I can say that user.$id._index/index.tsx can be located in folder, but not it's layout user.$id/index.tsx that needs to be a file user.$id.tsx

@MichaelDeBoey
Copy link
Member

Closed by #5228

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-a024557-20230207 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Successfully merging a pull request may close this issue.

3 participants