-
-
Notifications
You must be signed in to change notification settings - Fork 237
feat: hint assets emit name conflict #6559
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
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
This PR enhances error reporting by adding a helpful hint when multiple assets emit different content to the same filename, guiding users to adjust their output.filename configuration.
- Adds
hintAssetsConflictfunction to detect and enhance asset name conflict error messages - Integrates the new hint function into the error formatting pipeline
- Includes an e2e test case to verify the hint is displayed correctly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/core/src/helpers/format.ts | Adds hintAssetsConflict function and integrates it into the error message formatting |
| e2e/cases/assets/filename-conflict-hint/src/index.js | Test source file that imports two image assets to trigger name conflict |
| e2e/cases/assets/filename-conflict-hint/rsbuild.config.ts | Test configuration that causes asset filename conflict by setting both images to the same name |
| e2e/cases/assets/filename-conflict-hint/index.test.ts | Test case that verifies the hint message is displayed when asset name conflict occurs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return message; | ||
| } | ||
|
|
||
| const hintAssetsConflict = (message: string): string => { |
Copilot
AI
Nov 12, 2025
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.
[nitpick] Inconsistent function declaration style. The function hintAssetsConflict uses arrow function syntax with const, while hintUnknownFiles (line 85) uses traditional function declaration. For consistency within the file, consider changing to: function hintAssetsConflict(message: string): string {
| return message; | ||
| } | ||
|
|
||
| const extraMessage = `You may need to adjust ${color.yellow('output.filename')} configuration to prevent name conflicts. (See ${color.yellow('https://rsbuild.rs/config/output/filename')})`; |
Copilot
AI
Nov 12, 2025
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.
[nitpick] The long message string on line 151 exceeds typical line length conventions, making it harder to read and maintain. Consider breaking it into multiple lines or using string concatenation for better readability.
| const extraMessage = `You may need to adjust ${color.yellow('output.filename')} configuration to prevent name conflicts. (See ${color.yellow('https://rsbuild.rs/config/output/filename')})`; | |
| const extraMessage = | |
| `You may need to adjust ${color.yellow('output.filename')} configuration to prevent name conflicts. ` | |
| + `(See ${color.yellow('https://rsbuild.rs/config/output/filename')})`; |
chenjiahan
left a comment
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.
👍

Summary
Enhance hint for assets emit name conflict
Related Links
Checklist