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 Convention nested folders error #5849

Closed
1 task done
MajorTom327 opened this issue Mar 20, 2023 · 2 comments
Closed
1 task done

Routing V2 Convention nested folders error #5849

MajorTom327 opened this issue Mar 20, 2023 · 2 comments

Comments

@MajorTom327
Copy link

MajorTom327 commented Mar 20, 2023

What version of Remix are you using?

v1.14.3

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

  • Yes

Steps to Reproduce

Create thoses files and directory for the routing system.

routes
├── _index.ts
├── statistics/
│   └── index.tsx
└── statistics._index/
    ├── index.tsx
    └── StatBlock/
        ├── index.ts
        └── StatBlock.tsx

statistics._index/index.tsx is using the component (Not a route) statistics._index/StatBlock/index (Re-exported, in my case I got multiples components in this directory)

Run yarn remix routes

Expected Behavior

Should generate the routes correctly and do not expect a subdirectory to be a subroute definition as defined in the documentation Folders for Organization section

<Routes>
  <Route file="root.tsx">
    <Route file="routes/index.tsx" />
    <Route path="statistics" file="routes/statistics/index.tsx">
      <Route index file="routes/statistics._index/index.tsx" />
    </Route>
  </Route>
</Routes>

Actual Behavior

Running yarn remix routes throw an exception as remix handle the sub-directory as the v1 convention and the component directory is considered as a subroute and no subroutes can't be defined in a _index route.

image

I made a simple reproduction project you can find here: https://github.com/MajorTom327/remix-route-v2

@irshadahmad21
Copy link

Duplicate of #5828

@MajorTom327
Copy link
Author

True. Didn't saw that issue.
Closing.

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

2 participants