Skip to content

Conversation

owlstronaut
Copy link
Contributor

@owlstronaut owlstronaut commented Mar 24, 2025

fixes #5730

Overrides that use a dollar sign need to resolve to a version string found in one of the package’s dependency fields. We now try two sources in order:

Root Manifest (via sourceReference or this.#from.root.package):
When a node is loaded from a sourceReference or if the node is part of a larger tree, the root package manifest is the first choice because it reflects the “authoritative” set of dependency versions that were installed.

Local Manifest (this.#from.package):
If the root manifest does not contain the key (for example, the dependency version isn’t listed there), we fall back to the local package manifest. This is usually more specific to the individual module and may include dependency fields that the root manifest omits.

This two-step lookup ensures that if the expected dependency isn’t available at the root level—even though it might be defined locally—the override can still resolve correctly. Without this fallback, the override resolution would fail with an error, even though the local package had the required dependency version.

@owlstronaut owlstronaut force-pushed the owlstronaut/fix-reference-overrides branch from a2a8d09 to 2dfb9bc Compare March 25, 2025 16:45
@owlstronaut owlstronaut force-pushed the owlstronaut/fix-reference-overrides branch from 2dfb9bc to dc45d6e Compare March 25, 2025 16:47
@owlstronaut owlstronaut marked this pull request as ready for review March 25, 2025 22:17
@owlstronaut owlstronaut requested a review from a team as a code owner March 25, 2025 22:17
@owlstronaut owlstronaut merged commit 04f53ce into latest Mar 27, 2025
18 checks passed
@owlstronaut owlstronaut deleted the owlstronaut/fix-reference-overrides branch March 27, 2025 18:04
@github-actions github-actions bot mentioned this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unable to resolve reference $react

2 participants