Fix confusing error when files have same name but different case#13958
Merged
nachocodoner merged 4 commits intometeor:release-3.4from Nov 7, 2025
Merged
Conversation
- Add case-sensitive filename collision detection in import-scanner.ts - Throw clear error message when files differ only in case - Fixes meteor#13785
✅ Deploy Preview for v3-meteor-api-docs canceled.
|
✅ Deploy Preview for v3-migration-docs canceled.
|
Member
|
I'll take some time to test this locally. Not sure if logging an error is the best approach, instead of just resolving it properly. Though it may be seem fine this solution according to your report details. Marking it for 3.4, so I can review it later for contributions. Thank you for your contribution 🚀 |
Contributor
Author
|
Hey @nachocodoner! Thanks for reviewing this. Since this PR won’t be merged right away, could you please add the hacktoberfest-accepted label so it counts for the event? Appreciate it! |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix confusing error when files have same name but different case
Problem
When two files exist in the same directory with identical names but different case (e.g.,
fooBar.tests.jsandFooBar.tests.js), Meteor would crash with a confusing source-map error instead of providing a clear message about the filename collision.Original Error:
Solution
Added case-sensitive filename collision detection in the
addFilemethod ofimport-scanner.ts. Now when files differ only in case, the build process throws a clear, actionable error message:Changes Made
tools/isobuild/import-scanner.tsaddFile()old.absPath !== absPathbut they resolve to the same case-insensitive pathRoot Cause
The import scanner uses
absPath.toLowerCase()to check for duplicate files, making it case-insensitive. However, when two files have the same lowercase path but different actual paths, the system tries to combine them usingcombineFiles(), which fails because the source maps cannot be properly merged.Testing
The fix has been tested to ensure:
Fixes #13785