Skip to content

fix(build): prevent rimraf glob crash on Windows by injecting --glob …#8130

Merged
alexander-akait merged 2 commits intowebpack:mainfrom
jay7-tech:fix/windows-build-crash-rimraf
Mar 27, 2026
Merged

fix(build): prevent rimraf glob crash on Windows by injecting --glob …#8130
alexander-akait merged 2 commits intowebpack:mainfrom
jay7-tech:fix/windows-build-crash-rimraf

Conversation

@jay7-tech
Copy link
Copy Markdown
Contributor

I hit a terminal crash when trying to run npm run build locally on Windows.

The clean-printable and clean scripts throw an EINVAL (Illegal characters) error because rimraf ^6 stops globbing by default and relies on the Unix shell to expand **. On Windows, cmd passes ** literally, which causes fs.rm to crash instantly.

Adding the explicit --glob flag to these scripts lets rimraf handle the wildcards internally, fixing the build crash completely for Windows contributors.

What kind of change does this PR introduce?

build / fix

Did you add tests for your changes?

N/A (This restores the ability for Windows users to execute the existing build scripts).

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

N/A

Use of AI

Debugged locally from a custom Windows development environment.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Mar 27, 2026 2:45pm

Request Review

@alexander-akait alexander-akait merged commit 046a2b1 into webpack:main Mar 27, 2026
9 checks passed
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