-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
fix: decode Windows paths to prevent ENOENT in dev mode #14057
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e1d776d The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @drewkovihair, Welcome, and thank you for contributing to React Router! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected]. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Let me know if anything needs adjusting — happy to tweak as needed! |
Please commit a currently failing test with the PR and we'll get it merged. It feels like a node bug to me though due to the fact a path is being resolved with, fed through a normalization method, then failing through another method when they are all node native APIs. Node should natively handle a path resolved by, transformed by, and passed to yet another native function. Do you have a link to the "long-standing issue for Windows"? That would make me feel "better" about merging something platform specific. |
…ENT error with encoded paths - Validates decodeURIComponent fix works - Includes standalone validation proof
Added the failing test as requested! Evidence this is a documented Windows issue:
Validation: Run |
Fix: Decode Windows Paths in dev mode to prevent ENOENT
Summary
This fixes an error on Windows when running Hydrogen/React Router projects from folders that include spaces (e.g.
D:\KOVI HAIR
).The Vite plugin currently passes encoded
%20
paths intoreadFileSync
, causing:Fix
We now decode
routeFilePath
before reading it:Notes