Skip to content

Conversation

@hardfist
Copy link
Contributor

Summary

throw error when passing unsupported browserslist query

Related links

facebook/docusaurus#11496

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@hardfist hardfist requested a review from h-a-n-a as a code owner October 18, 2025 13:39
@Copilot Copilot AI review requested due to automatic review settings October 18, 2025 13:39
@netlify
Copy link

netlify bot commented Oct 18, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 8cd9638
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f4816c5542a60008085f43

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 18, 2025
Copy link
Contributor

Copilot AI left a 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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2025

📦 Binary Size-limit

Comparing 8cd9638 to test: add warn while closing compiler with failure (#11909) by harpsealjs

❌ Size increased by 512bytes from 47.67MB to 47.67MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 18, 2025

CodSpeed Performance Report

Merging #11914 will not alter performance

Comparing yj/error-unsupported-version (8cd9638) with main (ceb5a7e)1

Summary

✅ 17 untouched

Footnotes

  1. No successful run was found on main (beafb11) during the generation of this report, so ceb5a7e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@hardfist hardfist force-pushed the yj/error-unsupported-version branch from a836ee5 to 23611ca Compare October 18, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant