diff --git a/packages/compiler-cli/src/ngtsc/imports/src/emitter.ts b/packages/compiler-cli/src/ngtsc/imports/src/emitter.ts index c52d5a4d39..f9052c8182 100644 --- a/packages/compiler-cli/src/ngtsc/imports/src/emitter.ts +++ b/packages/compiler-cli/src/ngtsc/imports/src/emitter.ts @@ -54,8 +54,8 @@ export interface ReferenceEmitStrategy { /** * Generates `Expression`s which refer to `Reference`s in a given context. * - * A `ReferenceEmitter` uses one or more `ReferenceEmitStrategy` implementations to produce a - * an `Expression` which refers to a `Reference` in the context of a particular file. + * A `ReferenceEmitter` uses one or more `ReferenceEmitStrategy` implementations to produce an + * `Expression` which refers to a `Reference` in the context of a particular file. */ export class ReferenceEmitter { constructor(private strategies: ReferenceEmitStrategy[]) {} diff --git a/packages/compiler-cli/src/ngtsc/imports/src/find_export.ts b/packages/compiler-cli/src/ngtsc/imports/src/find_export.ts index 71a4d45d35..681e49a3e6 100644 --- a/packages/compiler-cli/src/ngtsc/imports/src/find_export.ts +++ b/packages/compiler-cli/src/ngtsc/imports/src/find_export.ts @@ -23,9 +23,10 @@ export function findExportedNameOfNode( // Look for the export which declares the node. const found = exports.find(sym => symbolDeclaresNode(sym, target, checker)); if (found === undefined) { - throw new Error(`failed to find target in ${file.fileName}`); + throw new Error( + `Failed to find exported name of node (${target.getText()}) in '${file.fileName}'.`); } - return found !== undefined ? found.name : null; + return found.name; } /**