rspack icon indicating copy to clipboard operation
rspack copied to clipboard

Build hangs when using :global selector in css module with apostrophes

Open martinkadlec0 opened this issue 1 year ago • 4 comments

System Info

Mac OS 13.6, Node 18, rspack 0.5.0

Details

While converting an old webpack project to rspack, I found a line of code that would hang the build process. Specifically:

// some.module.css :global('something') { ... }

I wasn't able to find if using apostrophes has any special meaning in this case or if it was a mistake when writing the code. Regardless, I would expect that the build either fails or ignores it instead of being stuck.

Reproduce link

https://github.com/martinkadlec0/rspack-global-bug/

Reproduce Steps

Clone repo Run: npm run build

Or just add the :global('something') to any css module.

martinkadlec0 avatar Jan 10 '24 20:01 martinkadlec0

This is caused by SWC, when parsing CSS with invalid apostrophes, it probably went into a infinite loop so we can't get the error result of it

JSerFeng avatar Jan 16 '24 04:01 JSerFeng

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Mar 16 '24 08:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar May 15 '24 13:05 stale[bot]

Seems to be fixed in 0.7 👍

martinkadlec0 avatar May 28 '24 10:05 martinkadlec0