fix(compiler): report a reasonable error with invalid metadata (#20062)
The compiler would throw an internal exception if an import using the `ngModule` syntax and the module as not a resolvable symbol. Fixes: #20049
This commit is contained in:

committed by
Victor Berchet

parent
880201681f
commit
bf22f2df88
@ -664,16 +664,18 @@ export class CompileMetadataResolver {
|
||||
}
|
||||
|
||||
private _getTypeDescriptor(type: Type): string {
|
||||
if (this.isDirective(type)) {
|
||||
return 'directive';
|
||||
}
|
||||
if (isValidType(type)) {
|
||||
if (this.isDirective(type)) {
|
||||
return 'directive';
|
||||
}
|
||||
|
||||
if (this.isPipe(type)) {
|
||||
return 'pipe';
|
||||
}
|
||||
if (this.isPipe(type)) {
|
||||
return 'pipe';
|
||||
}
|
||||
|
||||
if (this.isNgModule(type)) {
|
||||
return 'module';
|
||||
if (this.isNgModule(type)) {
|
||||
return 'module';
|
||||
}
|
||||
}
|
||||
|
||||
if ((type as any).provide) {
|
||||
|
Reference in New Issue
Block a user