-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Using route("/", "routes/home.tsx")
messes up auto-generated types, creating a type error
#13182
Comments
Same issue as title, 7.3.0, using route('/', 'routes/home.tsx') instead of index('routes/home.tsx). #13140 did not resolve. Switched to using route instead of index due to unrelated issue posting to index (still trying to figure out minimal reproduction for that). Sticking to 7.1.5 for now. Edit: figured out the index post issue, at least in 7.1.5 have to use /?index - in 7.1.5 we get a 405 method not allowed error and console error describing issue if trying to post to just /, but in 7.2.0/7.3.0 this seems to create a CPU race/memory leak leading to application crash. Will try and provide minimal recreation in a separate issue. |
Workaround that I'm using for now: // routes.ts
layout("routes/home.tsx", [
index("routes/blank.tsx"),
])
// routes/blank.tsx
export default Blank() {
return null;
} |
Not sure if my issue is related or not, but I now have missing routes. With 7.2.0 I've updated and am using Just thought I'd throw this out there in case there are others seeing the same. I'll report back if I find more. |
Fwiw, I've just been trying to debug a duplicate typegen'd identifier for "/" on 7.3 and think I've narrowed it down to the "fullpath" function returning "/" for the root route (since it always starts with a / and then appends the lineage) - which is then duplicated with the "/" path I've got for my top-level layout route. I can see the filtering fix in #13140 is doing its job and filtering out the index route inside my layout route but it doesn't resolve the duplication with the root route. |
I'm using React Router as a...
framework
Reproduction
Go to https://stackblitz.com/edit/github-t35rc7ny?file=app%2Froutes.ts
Note the route has been changed from
index
toroute('/'...
In the command line, run
npm run typecheck
System Info
Used Package Manager
npm
Expected Behavior
It should properly pass type checking without throwing any errors.
Actual Behavior
It throws the following error:
The text was updated successfully, but these errors were encountered: