Skip to content

fix(misc): use pathToFileURL for cross-platform path handling in postcss-cli-resources#34676

Merged
FrozenPandaz merged 1 commit intomasterfrom
gh-33052
Mar 3, 2026
Merged

fix(misc): use pathToFileURL for cross-platform path handling in postcss-cli-resources#34676
FrozenPandaz merged 1 commit intomasterfrom
gh-33052

Conversation

@leosvelperez
Copy link
Copy Markdown
Member

Current Behavior

CSS url() references to fonts and assets fail to resolve on Windows with webpack, rspack, and angular-rspack builds. The postcss-cli-resources plugin passes Windows absolute paths (e.g. E:\dev\project\font.woff2) to new URL(path, 'file:///'), which misinterprets the drive letter (E:) as a URL protocol, stripping it from pathname and producing unresolvable paths like \dev\project\font.woff2.

Expected Behavior

CSS url() references to fonts, images, and other assets resolve correctly on all platforms.

Related Issue(s)

Fixes #33052

…css-cli-resources

Replace manual `new URL(path, 'file:///')` with Node's `pathToFileURL`
for correct cross-platform file path to URL conversion in CSS url()
resolution.
@leosvelperez leosvelperez requested review from a team as code owners March 3, 2026 10:09
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 3, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 7beb52a
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69a6b340cb59a500089c0b86
😎 Deploy Preview https://deploy-preview-34676--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 3, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 7beb52a
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69a6b340fb391200083ab195
😎 Deploy Preview https://deploy-preview-34676--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Mar 3, 2026

View your CI Pipeline Execution ↗ for commit 7beb52a

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 6m 5s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 25s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-03 12:53:44 UTC

@leosvelperez leosvelperez self-assigned this Mar 3, 2026
@FrozenPandaz FrozenPandaz merged commit e81f187 into master Mar 3, 2026
25 of 26 checks passed
@FrozenPandaz FrozenPandaz deleted the gh-33052 branch March 3, 2026 16:08
FrozenPandaz pushed a commit that referenced this pull request Mar 4, 2026
…css-cli-resources (#34676)

## Current Behavior

CSS `url()` references to fonts and assets fail to resolve on Windows
with webpack, rspack, and angular-rspack builds. The
`postcss-cli-resources` plugin passes Windows absolute paths (e.g.
`E:\dev\project\font.woff2`) to `new URL(path, 'file:///')`, which
misinterprets the drive letter (`E:`) as a URL protocol, stripping it
from `pathname` and producing unresolvable paths like
`\dev\project\font.woff2`.

## Expected Behavior

CSS `url()` references to fonts, images, and other assets resolve
correctly on all platforms.

## Related Issue(s)

Fixes #33052

(cherry picked from commit e81f187)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

postcss-cli-resources can't resolve url

3 participants