Skip to content

React router type generation duplicate entry #157

@geemanjs

Description

@geemanjs

Hey 👋

Thanks for this library - used it for quite some time now.

I've found an issue which is sort of a "combo effect" of using this library + @react-router/remix-routes-option-adapter + react-router v7. Feel like this is probably the best place to start.

Heres a reproduction:
https://github.com/geemanjs/remix-flat-routes-reproduction

Steps to reproduce:

  1. pnpm install
  2. pnpm typecheck

You can run the app with:

  1. pnpm dev

There are two routes that are different routes - but have the same id in terms of the output of .react-router/types/+register.ts types.

In the browser we have two routes:

  1. /test-param/cheeses (Cheese List)
  2. /test-param/cheeses/2 (Cheese Item)

The route setup.

/test-param/cheeses
 |- $routeParam_/cheeses/index/index.tsx <- note the _ for no layout
/test-param/cheeses/2
 |- $routeParam/layout.tsx
   |- $routeParam/cheeses/layout.tsx
     |- $routeParam/cheeses/$cheeseId/index.tsx

From the react-router perspective I would assume they would expect you to set a different id property for the route.

Which is why I landed on this repo for raising the issue.

Hope you can help, I've been migrating a pretty large remix app and it all works apart from the type checking 😫 .

James

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions