Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): generate relative paths only in summary file errors #26759

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/compiler/src/aot/static_symbol_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ export class StaticSymbolResolver {
// correctly.
const originFilePath = this.resolveModule(origin, filePath);
if (!originFilePath) {
this.reportError(
new Error(`Couldn't resolve original symbol for ${origin} from ${filePath}`));
this.reportError(new Error(
`Couldn't resolve original symbol for ${origin} from ${this.host.getOutputName(filePath)}`));
} else {
this.symbolResourcePaths.set(symbol, originFilePath);
}
Expand Down Expand Up @@ -420,7 +420,8 @@ export class StaticSymbolResolver {
if (!filePath) {
return {
__symbolic: 'error',
message: `Could not resolve ${module} relative to ${sourceSymbol.filePath}.`,
message:
`Could not resolve ${module} relative to ${self.host.getMetadataFor(sourceSymbol.filePath)}.`,
line: map.line,
character: map.character,
fileName: getOriginalName()
Expand Down Expand Up @@ -504,7 +505,7 @@ export class StaticSymbolResolver {
if (moduleMetadata['version'] != SUPPORTED_SCHEMA_VERSION) {
const errorMessage = moduleMetadata['version'] == 2 ?
`Unsupported metadata version ${moduleMetadata['version']} for module ${module}. This module should be compiled with a newer version of ngc` :
`Metadata version mismatch for module ${module}, found version ${moduleMetadata['version']}, expected ${SUPPORTED_SCHEMA_VERSION}`;
`Metadata version mismatch for module ${this.host.getOutputName(module)}, found version ${moduleMetadata['version']}, expected ${SUPPORTED_SCHEMA_VERSION}`;
this.reportError(new Error(errorMessage));
}
this.metadataCache.set(module, moduleMetadata);
Expand All @@ -518,7 +519,7 @@ export class StaticSymbolResolver {
if (!filePath) {
this.reportError(
new Error(`Could not resolve module ${module}${containingFile ? ' relative to ' +
containingFile : ''}`));
this.host.getOutputName(containingFile) : ''}`));
return this.getStaticSymbol(`ERROR:${module}`, symbolName);
}
return this.getStaticSymbol(filePath, symbolName);
Expand Down