-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(turbopack-node) postcss.config.js path resolution on Windows #7995
Conversation
With the wrong name, it just silently hangs on the compilation step :/
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
✅ This change can build |
|
There's a CI failure on Windows:
However, other pull requests appear to be failing with this same error, so I don't think this is related to my PR. I'm going to go ahead and merge. |
|
||
const mod = await __turbopack_external_import__(configPath); | ||
const configPath = `${{process.cwd()}}/${{{config_path}}}`; |
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.
This would better use path.join
since the /
is technically not the correct path separator on windows.
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.
@sokra I was trying to keep the change small, and I saw in the node documentation that:
On Windows, both the forward slash (/) and backward slash () are accepted as path segment separators; however, the path methods only add backward slashes ().
If you'd like, I can submit a follow-up PR.
Edit: #8105
Absolute paths don't work for imports on windows because `c:\` is interpreted as a URI scheme. The workaround is to use an unambiguous `file://` URI. Fixes vercel/next.js#63755 Similar to vercel/next.js#64386
…ution on Windows * vercel/turborepo#7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows -->
…ution on Windows (#64677) Not 100% sure I did this process right for a hotfix, but this new tag should be exactly the same as what's currently in the 14-2-1 branch, except with this one PR: * vercel/turborepo#7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows --> --- In turbo, I ran ``` git switch --detach turbopack-240411.3 git switch -c bgw/hotfix-turbopack-14-2-1 git cherry-pick e7a5c60a3b899d0c4293589c2844016da82442f7 git push origin HEAD ``` I then ran the GitHub action for the nightly release process for that new branch: https://github.com/vercel/turbo/actions/workflows/turbopack-nightly-release.yml (it seems like this just cuts a tag, I wonder for hotfixes if we should manually cut the tag so it's named differently) In the nextpack repository: ``` pnpm next-link turbopack-240417.2 ```
* vercel/turborepo#7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows --> (plus unrelated turborepo + CI changes)
* vercel/turborepo#7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows --> (plus unrelated turborepo + CI changes) This PR should not be cherrypicked into the 14-2-1 branch. Instead #64677 should be merged into that branch, as that PR contains only the one above Windows commit.
Follow-up suggested in #7995 (comment)
### Description A followup requested by @sokra in #7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for #7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
### Description A followup requested by @sokra in vercel#7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for vercel#7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
…cel/turborepo#7995) Absolute paths don't work for imports on windows because `c:\` is interpreted as a URI scheme. The workaround is to use an unambiguous `file://` URI. Fixes #63755 Similar to #64386
### Description A followup requested by @sokra in vercel/turborepo#7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for #7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
…cel/turborepo#7995) Absolute paths don't work for imports on windows because `c:\` is interpreted as a URI scheme. The workaround is to use an unambiguous `file://` URI. Fixes #63755 Similar to #64386
### Description A followup requested by @sokra in vercel/turborepo#7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for #7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
…cel/turborepo#7995) Absolute paths don't work for imports on windows because `c:\` is interpreted as a URI scheme. The workaround is to use an unambiguous `file://` URI. Fixes #63755 Similar to #64386
### Description A followup requested by @sokra in vercel/turborepo#7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for #7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
…cel/turborepo#7995) Absolute paths don't work for imports on windows because `c:\` is interpreted as a URI scheme. The workaround is to use an unambiguous `file://` URI. Fixes #63755 Similar to #64386
### Description A followup requested by @sokra in vercel/turborepo#7995 (comment) There's no meaningful change in behavior here, as node on windows interprets both `/` and `\` as valid path separators, but this makes the intent clearer. ### Testing Instructions <details><summary>Repeated the test plan for #7995. Tested on both Windows and Linux.</summary> ![Screenshot 2024-05-07 at 2.22.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/bf7afcfb-0834-454a-b5ee-f52ae736eb47.png) </details> Closes PACK-3049
* vercel/turborepo#7995 <!-- Benjamin Woodruff - fix(turbopack-node) postcss.config.js path resolution on Windows --> (plus unrelated turborepo + CI changes) This PR should not be cherrypicked into the 14-2-1 branch. Instead #64677 should be merged into that branch, as that PR contains only the one above Windows commit.
Description
Absolute paths don't work for imports on windows because
c:\
is interpreted as a URI scheme. The workaround is to use an unambiguousfile://
URI.Fixes vercel/next.js#63755
Similar to vercel/next.js#64386
Testing Instructions
patch next.js's Cargo.toml to point to the updated branch
build the next-swc binary
Run `next dev` in the test repo
Closes PACK-2972