diff --git a/packages/core/src/effect/layer-node.ts b/packages/core/src/effect/layer-node.ts index b58692a1553..9dbc3d51607 100644 --- a/packages/core/src/effect/layer-node.ts +++ b/packages/core/src/effect/layer-node.ts @@ -230,7 +230,7 @@ export function hoist { const allReplacements = replacements.concat([[Location.node, Location.boundNode(ref)]]) + // Apply replacements during hoist, not afterward: replacements can + // introduce new tagged dependencies (Location.boundNode depends on + // Project), and the hoist walk is the only pass that can still slice + // those back out. const location = LayerNode.hoist(locationServices, Node.tags.values.global, allReplacements) return LayerNode.compile(location.node).pipe(