diff --git a/packages/core/src/render3/jit/util.ts b/packages/core/src/render3/jit/util.ts index c46504baef..0bcc8da424 100644 --- a/packages/core/src/render3/jit/util.ts +++ b/packages/core/src/render3/jit/util.ts @@ -49,7 +49,10 @@ function reflectDependency(compiler: CompilerFacade, dep: any | any[]): R3Depend } for (let j = 0; j < dep.length; j++) { const param = dep[j]; - if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') { + if (param === undefined) { + // param may be undefined if type of dep is not set by ngtsc + continue; + } else if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') { meta.optional = true; } else if (param instanceof SkipSelf || param.__proto__.ngMetadataName === 'SkipSelf') { meta.skipSelf = true;