Replies: 1 comment
-
I'm having the same problem after migrating from Remix v2 to RR7, I noticed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm transitioning from using Remix v2 to React Router v7 for a new project. I've bootstrapped the project using React Router v7 and am exploring ways to manage routing effectively. I decided to use
remix-flat-routes
because of its robust and flexible support for deeply nested route files, which I found essential in my previous Remix projects.Here's where things stand:
remix-flat-routes
with theRouterProvider
adapter works perfectly for managing the routes.react-router typegen
command, the generated types each import a../{filename}.js
file.When I run a type check this reference fails with an error saying it cannot find that file.
Interestingly, when I switch to using
fs-routes
instead ofremix-flat-routes
, the types work as intended without any issues.That said, I really need the deep file nesting capabilities that
remix-flat-routes
provides and would like to make this work while still benefiting fromreact-router typegen
.What I’ve Tried
remix-flat-routes
configuration to ensure all paths and settings align with my project structure..js
import but couldn't resolve why it fails.fs-routes
as a comparison, which confirmed that the issue lies specifically with usingremix-flat-routes
.Question
Is there a configuration option or a workaround that can make
react-router typegen
generate compatible types when usingremix-flat-routes
? I assume I am doing something wrong and I'm really hoping someone can point me at what it is.Any pointers or suggestions would be greatly appreciated!
Here's my routes.ts config for reference:
Error I'm seeing is (same for each generated route):
Beta Was this translation helpful? Give feedback.
All reactions