-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(compiler-sfc): malformed filename on windows using path.posix.join() #9478
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(compiler-sfc): malformed filename on windows using path.posix.join() #9478
Conversation
|
@sodatea I recreated this fix and added more details. Thank you in advance! FYI: @edison1105 |
|
@b12k can you provide an example of this error happening, I've been using windows and haven't noticed this issue. |
Size ReportBundles
Usages
|
|
Test I will update the test to illustrate the issue |
haoqunjiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joinPaths is also used in minimatch patterns:
| included.some(p => isMatch(containingFile, joinPaths(base, p))) |
I'm afraid that's what's causing the Windows test failures: https://github.com/vuejs/core/actions/runs/6651662225/job/18074220591?pr=9478
I recommend only modifying the code that resolves the relative path to avoid accidental breakages.
|
|
@sodatea May I please ask you to have a look one more time? |
I created a test case for that You may reproduce that by adding a test case like in PR and try running unit tests on Windows. |
|
@sodatea I really need this fix =) We can not directly import types/interfaces, and using (redundant file) *.ts import/export workaround. |

Closes: #8671, #9583
Not fixed with: #9446
Related: #9473
On Windows
path.posixis available butpath.posix.join()returns malformed result when joining paths containing..like../folderOrFileError:

where
../basefolder containsindex.tswith "re-exports" like:Simple reproducible example (on Windows):
Save the following as
index.jsand runnode index.jsFix forces to use
path.join()instead ofpath.posix.join()on Windows.