fix(compiler-sfc): malformed filename on windows using path.posix.join()#9478
fix(compiler-sfc): malformed filename on windows using path.posix.join()#9478yyx990803 merged 8 commits intovuejs:mainfrom b12k:fix/malformed-filename-on-windows-with-path-posix-join
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.
joinPaths is also used in minimatch patterns:
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.