fix(compiler): Improve error message for missing annotations (#14724)
Currently, it says: Unexpected value 'FuzzyTimePipe in javascript/angular2/example/search/fuzzy_time.ts' declared by the module 'SearchModule in javascript/angular2/example/search/search_module.ts' The new error message also suggests: 'Please add a @Pipe/@Directive/@Component annotation.'
This commit is contained in:

committed by
Chuck Jazdzewski

parent
ff60c041f6
commit
3c15916e17
@ -433,7 +433,7 @@ export class CompileMetadataResolver {
|
||||
if (!importedModuleSummary) {
|
||||
this._reportError(
|
||||
syntaxError(
|
||||
`Unexpected ${this._getTypeDescriptor(importedType)} '${stringifyType(importedType)}' imported by the module '${stringifyType(moduleType)}'`),
|
||||
`Unexpected ${this._getTypeDescriptor(importedType)} '${stringifyType(importedType)}' imported by the module '${stringifyType(moduleType)}'. Please add a @NgModule annotation.`),
|
||||
moduleType);
|
||||
return;
|
||||
}
|
||||
@ -491,7 +491,7 @@ export class CompileMetadataResolver {
|
||||
} else {
|
||||
this._reportError(
|
||||
syntaxError(
|
||||
`Unexpected ${this._getTypeDescriptor(declaredType)} '${stringifyType(declaredType)}' declared by the module '${stringifyType(moduleType)}'`),
|
||||
`Unexpected ${this._getTypeDescriptor(declaredType)} '${stringifyType(declaredType)}' declared by the module '${stringifyType(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`),
|
||||
moduleType);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user