-
-
Notifications
You must be signed in to change notification settings - Fork 728
fix(core): throw error when passing unsupported Node.js version browserslist query #11914
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack canceled.
|
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.
Pull Request Overview
Adds explicit error handling for invalid Browserslist queries so unsupported Node.js versions cause a build error rather than being silently ignored.
- Change load_browserslist to return Result and enable throw_on_missing to surface invalid queries
- Propagate errors through the N-API binding with a clear message; add tests for unsupported Node.js versions
- Minor test adjustments in builder tests
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_browserslist/src/load_config.rs | Return Result, enable throw_on_missing, and adjust success/error mapping |
| crates/rspack_browserslist/src/lib.rs | Re-export browserslist::Error for external use |
| crates/rspack_binding_api/src/browserslist.rs | Change N-API binding to return Result and map errors to napi::Error with a prefixed message |
| crates/rspack/src/builder/mod.rs | Update is_some to is_ok due to Result return type; behavior check uses success status |
| crates/rspack/src/builder/browserslist_target.rs | Update tests to unwrap on success and add a test for unsupported node version |
| tests/rspack-test/configCases/errors/wrong-browserslist/* | Add integration test case asserting an error for an unsupported Node.js version in Browserslist |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
❌ Size increased by 512bytes from 47.67MB to 47.67MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #11914 will not alter performanceComparing Summary
Footnotes |
a836ee5 to
23611ca
Compare
23611ca to
8cd9638
Compare
Summary
throw error when passing unsupported browserslist query
Related links
facebook/docusaurus#11496
Checklist