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(compiler-sfc): malformed filename on windows using path.join() #9475

Closed
wants to merge 1 commit into from
Closed

fix(compiler-sfc): malformed filename on windows using path.join() #9475

wants to merge 1 commit into from

Conversation

b12k
Copy link
Contributor

@b12k b12k commented Oct 25, 2023

On Windows OS
"(path.posix || path)" still resolves to "path.posix"
which leads to a malformed "join()" filename path

Related to #9473

Reproduce (on Windows):

const path = require('path');

console.log({
    join: path.resolve(__filename, '..'), // ✅ >> "'C:\\code\\sandbox\\posix-path'"
    posixJoin: path.posix.join(__filename, '..'), // ❌ >> "."
    resolve: path.resolve(__filename, '..'), // ✅ >> "C:\\code\\sandbox\\posix-path"
    posixResolve: path.posix.resolve(__filename, '..'), // ✅ >> /code/sandbox/posix-path
})

Fix forces to use path.join() instead of path.posix.join() on Windows.

@haoqunjiang
Copy link
Member

Do you have a runnable reproduction? I believe this has already been fixed in #9446
A full path with mixed / and \ should still be a valid Windows path.

@b12k
Copy link
Contributor Author

b12k commented Oct 25, 2023

I confirm that it's fixed in latest release.

Not fixed

@b12k b12k closed this Oct 25, 2023
@b12k b12k deleted the fix/malformed-filename-on-windows-with-path-join branch October 25, 2023 18:26
@b12k
Copy link
Contributor Author

b12k commented Oct 25, 2023

@sodatea I re-opend the PR with this fix.
#9478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants