diff --git a/packages/core/src/DirectoryLoader.ts b/packages/core/src/DirectoryLoader.ts index 4b55f6b24d147..6a5c195d8cffa 100644 --- a/packages/core/src/DirectoryLoader.ts +++ b/packages/core/src/DirectoryLoader.ts @@ -371,7 +371,9 @@ export class LazyPackageDirectoryLoader extends PackageDirectoryLoader { if (this.includeNodes.length) { const allowedNodes: typeof this.known.nodes = {}; for (const nodeName of this.includeNodes) { - allowedNodes[nodeName] = this.known.nodes[nodeName]; + if (nodeName in this.known.nodes) { + allowedNodes[nodeName] = this.known.nodes[nodeName]; + } } this.known.nodes = allowedNodes;