Skip to content

fix: should throw error when custom config file not found#1403

Merged
Timeless0911 merged 1 commit intomainfrom
resolveConfigPath-not-found
Dec 24, 2025
Merged

fix: should throw error when custom config file not found#1403
Timeless0911 merged 1 commit intomainfrom
resolveConfigPath-not-found

Conversation

@9aoy
Copy link
Copy Markdown
Contributor

@9aoy 9aoy commented Dec 23, 2025

Summary

fix: should throw error when custom config file not found.

expect throw config not found error, but fallback to default config.

Related Links

web-infra-dev/rsbuild#6828

Checklist

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

Copilot AI review requested due to automatic review settings December 23, 2025 10:04
Copy link
Copy Markdown
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

This PR fixes a bug where specifying a non-existent custom config file with the --config flag would silently fall back to the default config instead of throwing an error. The fix ensures that when a user explicitly provides a custom config path, the build fails immediately if that file doesn't exist.

Key changes:

  • Changed from logging a warning to throwing an error when a custom config file is not found
  • Added an integration test to verify the error is thrown correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/config.ts Changed resolveConfigPath to throw an error instead of logging a warning when a custom config file doesn't exist
tests/integration/cli/build/build.test.ts Added test case to verify that a non-existent custom config file causes the build to fail with an appropriate error message

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@9aoy 9aoy requested a review from Timeless0911 December 23, 2025 10:50
@Timeless0911 Timeless0911 merged commit a526b2c into main Dec 24, 2025
23 checks passed
@Timeless0911 Timeless0911 deleted the resolveConfigPath-not-found branch December 24, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants