-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Middleware types not working with NodeNext
resolution
#13375
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
Comments
NodeNext
resolutionNodeNext
resolution
I am seeing the same issue but I am using the Possibly this is addressed by #13381 |
The linked issue is different one, that impacts that some types didn’t use the future flag branching. This issue is that this branching isn’t respected in some parts of code when using specific resolution 😃 |
Ye, I tested with |
I’m pretty sure it should work. Do you have some reproduction? Did you enable the type level feature flag and the file is in the same TS project in case you use references? |
Thanks - I am using the cloudflare template and it uses tsconfig projects. |
I'm using React Router as a...
framework
Reproduction
https://github.com/pawelblaszczyk5/invalid-new-middleware-types-node-next
app/routes/home.tsx
context
being typed incorrectly despite middleware being enabled and global type augmentation doneI think that's similar cause as this - #12715
If you change the module resolution to e.g.
Bundler
it will work properly.System Info
Used Package Manager
pnpm
Expected Behavior
context
parameter is properly typed due to augmentation inreact-router.config.ts
Actual Behavior
context
is incorrectly typed (stillAppLoadContext
) when usingNodeNext
The text was updated successfully, but these errors were encountered: