-
Notifications
You must be signed in to change notification settings - Fork 2.6k
cloudflareDevProxyVitePlugin
returns error type under NodeNext
module resolution
#9829
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
We require Node v18+ across all of our packages (e.g. https://github.com/remix-run/remix/blob/main/packages/remix-react/package.json#L50), so I don't think supporting |
These module resolution modes are for all modern Node.js versions, not for old ones. Per the TypeScript docs:
|
cloudflareDevProxyVitePlugin
returns error type under Node16
module resolutioncloudflareDevProxyVitePlugin
returns error type under NodeNext
module resolution
For context, Honestly, Vite probably screwed up here by shipping a CommonJS entry point with no types. There are much better ways to deprecate an entry point! But I think you can fix this with a TypeScript 5.3 feature that should let you import Vite's ESM types from your Vite plugin's CommonJS package: |
Thank you for opening this issue, and our apologies we haven't gotten around to it yet! With the release of React Router v7 we are sun-setting continued development/maintenance on Remix v2. If you have not already upgraded to React Router v7, we recommend you do so. We've tried to make the upgrade process as smooth as possible with our Future Flags. We are now in the process of cleaning up outdated issues and pull requests to improve the overall hygiene of our repositories. We plan to continue to address 2 types of issues in Remix v2:
If you believe this issue meets one of those criteria, please respond or create a new issue. For all other issues, ongoing maintenance will be happening in React Router v7, so:
If you have any questions you can always reach out on Discord. Thanks again for providing feedback and helping us make our framework even better! |
Uh oh!
There was an error while loading. Please reload this page.
Reproduction
typescript-eslint playground
System Info
Used Package Manager
pnpm
Expected Behavior
Switching TypeScript to
Node16
orNodeNext
module resolution should not affect the return type ofcloudflareDevProxyVitePlugin
.Actual Behavior
The
Plugin
type returned bycloudflareDevProxyVitePlugin()
doesn't exist.What I think is happening:
@remix-run/dev
is a CommonJS package.Node16
module resolution, TypeScript transitively resolves Vite's CJS types, wherePlugin
doesn't exist.Thankfully it's easy to work around.
I'm not sure if this would get better or worse once Vite v6 goes ESM-only, but hopefully React Router v7 can ship an ESM Vite plugin before then so we won't need to find out!
The text was updated successfully, but these errors were encountered: