Skip to content

Bug: Plugin hangs indefinitely on "protocol-relative URLs" (url("//example.com/...")) in CSS on Windows #250

@theArina

Description

@theArina

This issue appears only on Windows, likely due to the way the plugin //example.com/... as a local file path instead of an external resource. The plugin then tries to resolve and read the URL as if it were a file, causing Rollup to freeze indefinitely.

🛠 Steps to Reproduce:
Add the following to a CSS file:

@font-face {
    font-family: 'Open Sans';
    src: url("//example.com/fonts/open-sans.woff") format("woff");
}

Use rollup-plugin-styles in rollup.config.js:

import styles from 'rollup-plugin-styles'; // 4.0.0

export default {
  input: 'index.js',
  output: { file: 'dist/bundle.js', format: 'es' },
  plugins: [styles()]
};

package.json

...
"scripts": {
  "dev": "rollup -c"
}

✅ Expected Behavior:
The plugin should not attempt to resolve //example.com/... as a local file.
It should leave the URL unchanged in CSS.

As far as I debugged this, it happens here:

payload = await workQueue.add(loader.process.bind(ctx, payload));

when a name equals to postcss. You may just set a breakpoint at that exact line and see for yourself. After this it will just hang indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions