-
Notifications
You must be signed in to change notification settings - Fork 11.9k
fix(@angular/build): fix setup files duplicate modules #31791
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
fix(@angular/build): fix setup files duplicate modules #31791
Conversation
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates. Module duplicates can break many things such as dependency injection. Closes angular#31732
yjaaidi
commented
Nov 13, 2025
I tried to keep this the less intrusive possible but I wonder if the right fix wouldn't involve changes to TestRunner API.
Feel free to either pick this a quick fix and revert it after the release for a proper fix, or just see it as a spike and throw it away 😊
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.
I'm not happy with this.
I would rather have a single getEntrypoints that returns both test files and setup files then we would have to forward the setup file names to the executor somehow.
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.
This produces bundles named setup-test-setup which is weird.
An empty string would be better but collisions could happen with a setup file called spec-setup... or something.
Uh oh!
There was an error while loading. Please reload this page.
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates.
Module duplicates can break many things such as dependency injection.
setupFilesdirectly provided to the builder.Handling
setupFilesfrom the Vitest config requires substantial additional effort.PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #31732
What is the new behavior?
Does this PR introduce a breaking change?
Other information