Skip to content
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

fix: address file path mismatch when loading Vite config file on Windows (fix #12923) #13005

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

fwouts
Copy link
Contributor

@fwouts fwouts commented Apr 25, 2023

Description

This is a fix for #12923.

Optimisations in #12553 caused a regression on Windows, where on some systems the Vite config file path has a different casing than the file path passed by the Node.js loader in require.extensions, causing the equality check to fail.

Additional context

This appears not to be reproducible on GitHub CI, perhaps because the bug only occurs when the file system is case sensitive or not?


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Apr 25, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nickturrietta
Copy link

@fwouts Do you think this should also fix the #12553 regression for those of us on Windows with mapped local drives?

Ex. W:\myapp\vite.config.js => C:\websites\myapp\vite.config.js

In my case, since the bug was introduced, npm run build does not work in this folder W:\myapp but it works in the target folder C:\websites\myapp

@fwouts
Copy link
Contributor Author

fwouts commented Apr 26, 2023

@fwouts Do you think this should also fix the #12553 regression for those of us on Windows with mapped local drives?

Ex. W:\myapp\vite.config.js => C:\websites\myapp\vite.config.js

In my case, since the bug was introduced, npm run build does not work in this folder W:\myapp but it works in the target folder C:\websites\myapp

It's possible yes, do you have a stack trace to share?

@fwouts fwouts changed the title fix: address file path mismatch when loading Vite config file on Windows (fix #12923). fix: address file path mismatch when loading Vite config file on Windows (fix #12923) Apr 26, 2023
@nickturrietta
Copy link

@fwouts It's working fine in the target folder. But this is what I see in the local mapped drive.

stacktrace1

@fwouts
Copy link
Contributor Author

fwouts commented Apr 26, 2023

@nickturrietta yes, this PR should fix that.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix sounds good to me. I'm guessing node uses fs.realpath internally too so make sense to align the usage.

@bluwy bluwy added the p4-important Violate documented behavior or significantly improves performance (priority) label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants