Skip to content

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

Merged
chenjiahan merged 4 commits intomainfrom
resolveConfigPath-not-found
Dec 23, 2025
Merged

fix: should throw error when custom config file not found#6828
chenjiahan merged 4 commits 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.

before:
image

after:
image

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings December 23, 2025 09:32
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 23, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 40905a6
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/694a6318a178fd000803b3ec
😎 Deploy Preview https://deploy-preview-6828--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🟢 up 5 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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 changes the behavior when a custom configuration file specified via --config is not found. Instead of logging a warning and falling back to default configuration, it now throws an error to make the failure explicit and prevent silent fallback behavior.

Key Changes

  • Replaced logger.warn with throw new Error when a custom config file is not found
  • Added a test case to verify the error is thrown when a non-existent custom config is specified
  • Minor indentation formatting improvements for code style consistency

Reviewed changes

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

File Description
packages/core/src/loadConfig.ts Changed resolveConfigPath to throw an error instead of logging a warning when a custom config file is not found; also includes minor formatting changes
e2e/cases/cli/custom-config/index.test.ts Added test case to verify error is thrown when custom config file doesn't exist

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@chenjiahan chenjiahan enabled auto-merge (squash) December 23, 2025 09:39
@chenjiahan chenjiahan changed the title fix!: should throw error when custom config file not found fix: should throw error when custom config file not found Dec 23, 2025
@chenjiahan chenjiahan merged commit a6153d9 into main Dec 23, 2025
11 checks passed
@chenjiahan chenjiahan deleted the resolveConfigPath-not-found branch December 23, 2025 09:50
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