fix: remove effect packages from optimizePackageImports list#80761
Closed
fubhy wants to merge 1 commit into
Closed
fix: remove effect packages from optimizePackageImports list#80761fubhy wants to merge 1 commit into
optimizePackageImports list#80761fubhy wants to merge 1 commit into
Conversation
Contributor
|
Notifying the following users due to files changed in this PR based on this repo's notify modifiers: @timneutkens, @ijjk, @shuding, @huozhi: |
Member
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
This was referenced Jun 22, 2025
Author
|
Addressed properly in #80769 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The feature for
optimizeModuleImportsseems to originate hereThe effect packages were first introduced here.
The original intent seems to have been to optimise performance during development time. But it has questionable side effects outside of this intent.
The way aliases are generated here is problematic for at least two reasons:
a) multiple versions of the same package now have their root entrypoint aliased to the same package without taking proper module resolution into consideration
b) it only targets exact matches on root entrypoints - the module exports of these packages are still resolved with the normal module resolution algorithm
This combination means that we get completely undefined runtime behavior.
This PR removes the
effectpackages from this list to circumvent this problem as a last resort, but I'd suggest to fix this behavior more sustainably instead(!) as it has the potential to generate incredibly difficult to debug runtime behavior that differs between development & production. It makes it easy to ship application versions into production that are broken in ways that are not surfaced during development.The good intention to cirumvent the the module traversal and scanning performance impact in case of barrel file imports during development time is noble but it should not have the unintended side effects with these server path alias rewrites as observed.
NOTE: The negative impact of this behavior goes beyond
effectand would equally apply to some of the other packages in that list with potentially worse outcomes. Instead of explicitly breaking on load it would cause undefined runtime behavior for most other packages.