build icon indicating copy to clipboard operation
build copied to clipboard

Build Failed! error displayed in browser could be more helpful

Open nshahan opened this issue 6 years ago • 1 comments

If you have an error in an angular template file build_runner serve shows an error in the web browser that looks something like:

AssetNotFoundException: angular_components_example|lib/gallery/home.template.dart
#0      ScratchSpace.ensureAssets.<anonymous closure> (package:scratch_space/src/scratch_space.dart:98:23)
<asynchronous suspension>
#1      ScratchSpace.ensureAssets (package:scratch_space/src/scratch_space.dart:104:10)
#2      createUnlinkedSummary (package:build_modules/src/summary_builder.dart:70:22)
<asynchronous suspension>
#3      UnlinkedSummaryBuilder.build (package:build_modules/src/summary_builder.dart:37:13)
<asynchronous suspension>
#4      runBuilder.buildForInput (package:build/src/generate/run_builder.dart:43:21)
<asynchronous suspension>
.
.
.

But if you scroll back in the console you will find an earlier error that is much more helpful:

Generating .template.dart: Instance of 'Compiler' on angular_components_example|lib/gallery/home.dart: Unhandled exception in the AngularDart compiler!

Please report a bug: https://github.com/dart-lang/angular/issues/new
Template parse errors:
line 1, column 1 of HomeViewComponent: Cannot find matching close element to this
<div id="my-div">
^^^^^^^^^^^^^^^^^^^^^^^
#0      _AstExceptionHandler._reportExceptions (package:angular/src/compiler/ast_template_parser.dart:239:5)
#1      _AstExceptionHandler.maybeReportExceptions (package:angular/src/compiler/ast_template_parser.dart:220:7)
#2      AstTemplateParser.parse (package:angular/src/compiler/ast_template_parser.dart:61:22)
#3      OfflineCompiler._compileComponent (package:angular/src/compiler/offline_compiler.dart:181:56)
#4      OfflineCompiler.compile (package:angular/src/compiler/offline_compiler.dart:100:32)
#5      processTemplates.<anonymous closure> (package:angular/src/source_gen/template_compiler/template_processor.dart:76:29)
.
.
.

nshahan avatar Mar 02 '18 22:03 nshahan

Related: #1018

natebosch avatar Mar 03 '18 00:03 natebosch