<p dir="auto">Suppose you have an output <code class="notranslate">save</code> that is (incorrectly) connected to a non-stream:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Component(
  selector: 'editor',
  outputs: const ['save'],
  ...
)
class Editor {
  // Oops, this was supposed to be an output!
  void save() {
    saveToBackend();
  }
}"><pre class="notranslate"><span class="pl-k">@Component</span>(
  selector<span class="pl-k">:</span> <span class="pl-s">'editor'</span>,
  outputs<span class="pl-k">:</span> <span class="pl-k">const</span> [<span class="pl-s">'save'</span>],
  ...
)
<span class="pl-k">class</span> <span class="pl-c1">Editor</span> {
  <span class="pl-c">// Oops, this was supposed to be an output!</span>
  <span class="pl-k">void</span> <span class="pl-en">save</span>() {
    <span class="pl-en">saveToBackend</span>();
  }
}</pre></div>
<p dir="auto">and suppose you use it like this:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;div *ngIf=&quot;dataLoaded&quot;&gt;
  ... 100 lines of other template code...
  &lt;editor&gt;&lt;/editor&gt;
&lt;/div&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">*ngIf</span>="<span class="pl-s">dataLoaded</span>"<span class="pl-kos">&gt;</span>
  ... 100 lines of other template code...
  <span class="pl-kos">&lt;</span><span class="pl-ent">editor</span><span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">editor</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">Notice how this use of the <code class="notranslate">&lt;editor&gt;</code> tag doesn't even use <code class="notranslate">(save)</code>.<br>
Angular will aggressively try to listen to the <code class="notranslate">save</code> stream and fail with an error message sort of like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caught EXCEPTION: type '() =&gt; void' is not a subtype of type 'Stream' of 's'. in [dataLoaded in FooComponent@229:47]
ORIGINAL EXCEPTION: type '() =&gt; void' is not a subtype of type 'Stream' of 's'.
ORIGINAL STACKTRACE:
#0      ObservableWrapper.subscribe (package:angular2/src/facade/async.dart:28:46)
#1      DynamicChangeDetector.hydrateDirectives.&lt;anonymous closure&gt; (package:angular2/src/core/change_detection/dynamic_change_detector.dart:133:33)
#2      List.forEach (dart:core-patch/growable_array.dart:233)
#3      DynamicChangeDetector.hydrateDirectives (package:angular2/src/core/change_detection/dynamic_change_detector.dart:127:19)
#4      AbstractChangeDetector.hydrate (package:angular2/src/core/change_detection/abstract_change_detector.dart:189:10)
#5      AppView.init (package:angular2/src/core/linker/view.dart:160:25)
#6      RuntimeViewFactory.createViewFactory.&lt;anonymous closure&gt; (package:angular2/src/compiler/view_compiler.dart:516:12)
#7      AppViewManager_.createEmbeddedViewInContainer (package:angular2/src/core/linker/view_manager.dart:257:30)
#8      ViewContainerRef_.createEmbeddedView (package:angular2/src/core/linker/view_container_ref.dart:146:15)
#9      NgIf.ngIf= (package:angular2/src/common/directives/ng_if.dart:39:27)
#10     _LocalInstanceMirror.setField (dart:mirrors-patch/mirrors_impl.dart:503)
#11     ReflectionCapabilities.setter.&lt;anonymous closure&gt; (package:angular2/src/core/reflection/reflection_capabilities.dart:293:27)
#12     DynamicChangeDetector._updateDirectiveOrElement (package:angular2/src/core/change_detection/dynamic_change_detector.dart:266:21)
#13     DynamicChangeDetector.detectChangesInRecordsInternal (package:angular2/src/core/change_detection/dynamic_change_detector.dart:209:16)
#14     AbstractChangeDetector.detectChangesInRecords (package:angular2/src/core/change_detection/abstract_change_detector.dart:155:12)
#15     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:129:10)
#16     AbstractChangeDetector._detectChangesContentChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:247:12)
#17     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:130:10)
#18     AbstractChangeDetector._detectChangesContentChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:247:12)
#19     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:130:10)
#20     AbstractChangeDetector._detectChangesInViewChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:255:12)
#21     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:132:10)
#22     AbstractChangeDetector._detectChangesInViewChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:255:12)
#23     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:132:10)
#24     AbstractChangeDetector.detectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:115:10)
#25     ChangeDetectorRef_.detectChanges (package:angular2/src/core/change_detection/change_detector_ref.dart:209:14)
#26     ApplicationRef_.tick.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:516:63)
#27     List.forEach (dart:core-patch/growable_array.dart:233)
#28     ApplicationRef_.tick (package:angular2/src/core/application_ref.dart:516:32)
#29     ApplicationRef_.ApplicationRef_.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:406:16)
#30     _rootRun (dart:async/zone.dart:907)
#31     _ZoneDelegate.run (dart:async/zone.dart:502)
#32     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:291:21)
#33     _CustomZone.run (dart:async/zone.dart:802)
#34     _CustomZone.runGuarded (dart:async/zone.dart:708)
#35     NgZone.run (package:angular2/src/core/zone/ng_zone.dart:251:23)
#36     ApplicationRef_.ApplicationRef_.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:405:20)
#37     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:26)
#38     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#39     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:14)
#40     _rootRunUnary (dart:async/zone.dart:914)
#41     _CustomZone.runUnary (dart:async/zone.dart:810)
#42     _CustomZone.runUnaryGuarded (dart:async/zone.dart:716)
#43     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#44     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#45     _SyncBroadcastStreamController._sendData.&lt;anonymous closure&gt; (dart:async/broadcast_stream_controller.dart:389)
#46     _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:331)
#47     _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:388)
#48     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:256)
#49     NgZone._notifyOnTurnDone (package:angular2/src/core/zone/ng_zone.dart:157:26)
#50     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:300:13)
#51     _CustomZone.run (dart:async/zone.dart:802)
#52     _CustomZone.runGuarded (dart:async/zone.dart:708)
#53     NgZone.run (package:angular2/src/core/zone/ng_zone.dart:251:23)
#54     DomEventsPlugin.addEventListener.&lt;anonymous closure&gt; (package:angular2/src/platform/dom/events/dom_events.dart:19:42)
#55     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:26)
#56     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#57     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:14)
#58     _rootRunUnary (dart:async/zone.dart:914)
#59     _CustomZone.runUnary (dart:async/zone.dart:810)
#60     _CustomZone.runUnaryGuarded (dart:async/zone.dart:716)
#61     _CustomZone.bindUnaryCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:742)
#62     wrap_event_listener.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (dart:html:1189)
#63     JsObject._callMethod (dart:js:1153)
#64     JsNative.callMethod (dart:js:1170)
#65     Blink_JsNative_DomException.callMethod (dart:_blink:17259)
#66     BlinkHTMLElement.click_Callback_0_ (dart:_blink:5426)
#67     HtmlElement.click (dart:html:21018)
#68     Future.Future.microtask.&lt;anonymous closure&gt; (dart:async/future.dart:144)
#69     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#70     StackZoneSpecification.registerCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:127:48)
#71     _rootRun (dart:async/zone.dart:903)
#72     _CustomZone.run (dart:async/zone.dart:802)
#73     _CustomZone.runGuarded (dart:async/zone.dart:708)
#74     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:733)
#75     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#76     StackZoneSpecification.registerCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:127:48)
#77     _rootRun (dart:async/zone.dart:907)
#78     _CustomZone.run (dart:async/zone.dart:802)
#79     _CustomZone.runGuarded (dart:async/zone.dart:708)
#80     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:733)
#81     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#82     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#83     _ScheduleImmediateHelper._handleMutation (dart:html:49254)
#84     MutationObserver._create.&lt;anonymous closure&gt; (dart:html:27525)"><pre class="notranslate"><code class="notranslate">Caught EXCEPTION: type '() =&gt; void' is not a subtype of type 'Stream' of 's'. in [dataLoaded in FooComponent@229:47]
ORIGINAL EXCEPTION: type '() =&gt; void' is not a subtype of type 'Stream' of 's'.
ORIGINAL STACKTRACE:
#0      ObservableWrapper.subscribe (package:angular2/src/facade/async.dart:28:46)
#1      DynamicChangeDetector.hydrateDirectives.&lt;anonymous closure&gt; (package:angular2/src/core/change_detection/dynamic_change_detector.dart:133:33)
#2      List.forEach (dart:core-patch/growable_array.dart:233)
#3      DynamicChangeDetector.hydrateDirectives (package:angular2/src/core/change_detection/dynamic_change_detector.dart:127:19)
#4      AbstractChangeDetector.hydrate (package:angular2/src/core/change_detection/abstract_change_detector.dart:189:10)
#5      AppView.init (package:angular2/src/core/linker/view.dart:160:25)
#6      RuntimeViewFactory.createViewFactory.&lt;anonymous closure&gt; (package:angular2/src/compiler/view_compiler.dart:516:12)
#7      AppViewManager_.createEmbeddedViewInContainer (package:angular2/src/core/linker/view_manager.dart:257:30)
#8      ViewContainerRef_.createEmbeddedView (package:angular2/src/core/linker/view_container_ref.dart:146:15)
#9      NgIf.ngIf= (package:angular2/src/common/directives/ng_if.dart:39:27)
#10     _LocalInstanceMirror.setField (dart:mirrors-patch/mirrors_impl.dart:503)
#11     ReflectionCapabilities.setter.&lt;anonymous closure&gt; (package:angular2/src/core/reflection/reflection_capabilities.dart:293:27)
#12     DynamicChangeDetector._updateDirectiveOrElement (package:angular2/src/core/change_detection/dynamic_change_detector.dart:266:21)
#13     DynamicChangeDetector.detectChangesInRecordsInternal (package:angular2/src/core/change_detection/dynamic_change_detector.dart:209:16)
#14     AbstractChangeDetector.detectChangesInRecords (package:angular2/src/core/change_detection/abstract_change_detector.dart:155:12)
#15     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:129:10)
#16     AbstractChangeDetector._detectChangesContentChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:247:12)
#17     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:130:10)
#18     AbstractChangeDetector._detectChangesContentChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:247:12)
#19     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:130:10)
#20     AbstractChangeDetector._detectChangesInViewChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:255:12)
#21     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:132:10)
#22     AbstractChangeDetector._detectChangesInViewChildren (package:angular2/src/core/change_detection/abstract_change_detector.dart:255:12)
#23     AbstractChangeDetector.runDetectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:132:10)
#24     AbstractChangeDetector.detectChanges (package:angular2/src/core/change_detection/abstract_change_detector.dart:115:10)
#25     ChangeDetectorRef_.detectChanges (package:angular2/src/core/change_detection/change_detector_ref.dart:209:14)
#26     ApplicationRef_.tick.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:516:63)
#27     List.forEach (dart:core-patch/growable_array.dart:233)
#28     ApplicationRef_.tick (package:angular2/src/core/application_ref.dart:516:32)
#29     ApplicationRef_.ApplicationRef_.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:406:16)
#30     _rootRun (dart:async/zone.dart:907)
#31     _ZoneDelegate.run (dart:async/zone.dart:502)
#32     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:291:21)
#33     _CustomZone.run (dart:async/zone.dart:802)
#34     _CustomZone.runGuarded (dart:async/zone.dart:708)
#35     NgZone.run (package:angular2/src/core/zone/ng_zone.dart:251:23)
#36     ApplicationRef_.ApplicationRef_.&lt;anonymous closure&gt; (package:angular2/src/core/application_ref.dart:405:20)
#37     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:26)
#38     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#39     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:14)
#40     _rootRunUnary (dart:async/zone.dart:914)
#41     _CustomZone.runUnary (dart:async/zone.dart:810)
#42     _CustomZone.runUnaryGuarded (dart:async/zone.dart:716)
#43     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#44     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#45     _SyncBroadcastStreamController._sendData.&lt;anonymous closure&gt; (dart:async/broadcast_stream_controller.dart:389)
#46     _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:331)
#47     _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:388)
#48     _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:256)
#49     NgZone._notifyOnTurnDone (package:angular2/src/core/zone/ng_zone.dart:157:26)
#50     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:300:13)
#51     _CustomZone.run (dart:async/zone.dart:802)
#52     _CustomZone.runGuarded (dart:async/zone.dart:708)
#53     NgZone.run (package:angular2/src/core/zone/ng_zone.dart:251:23)
#54     DomEventsPlugin.addEventListener.&lt;anonymous closure&gt; (package:angular2/src/platform/dom/events/dom_events.dart:19:42)
#55     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:26)
#56     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#57     StackZoneSpecification.registerUnaryCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:137:14)
#58     _rootRunUnary (dart:async/zone.dart:914)
#59     _CustomZone.runUnary (dart:async/zone.dart:810)
#60     _CustomZone.runUnaryGuarded (dart:async/zone.dart:716)
#61     _CustomZone.bindUnaryCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:742)
#62     wrap_event_listener.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (dart:html:1189)
#63     JsObject._callMethod (dart:js:1153)
#64     JsNative.callMethod (dart:js:1170)
#65     Blink_JsNative_DomException.callMethod (dart:_blink:17259)
#66     BlinkHTMLElement.click_Callback_0_ (dart:_blink:5426)
#67     HtmlElement.click (dart:html:21018)
#68     Future.Future.microtask.&lt;anonymous closure&gt; (dart:async/future.dart:144)
#69     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#70     StackZoneSpecification.registerCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:127:48)
#71     _rootRun (dart:async/zone.dart:903)
#72     _CustomZone.run (dart:async/zone.dart:802)
#73     _CustomZone.runGuarded (dart:async/zone.dart:708)
#74     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:733)
#75     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:208:15)
#76     StackZoneSpecification.registerCallback.&lt;anonymous closure&gt; (package:stack_trace/src/stack_zone_specification.dart:127:48)
#77     _rootRun (dart:async/zone.dart:907)
#78     _CustomZone.run (dart:async/zone.dart:802)
#79     _CustomZone.runGuarded (dart:async/zone.dart:708)
#80     _CustomZone.bindCallback.&lt;anonymous closure&gt; (dart:async/zone.dart:733)
#81     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#82     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#83     _ScheduleImmediateHelper._handleMutation (dart:html:49254)
#84     MutationObserver._create.&lt;anonymous closure&gt; (dart:html:27525)
</code></pre></div>
<p dir="auto">Notice how obscure this error is.  It doesn't point to the erroneous line, it doesn't mention the faulty component, it complains about the nearest enclosing <code class="notranslate">ngIf</code>, as if it's at fault, and that <code class="notranslate">ngIf</code> might be <em>really</em> far away from the issue.  I wasted hours debugging this and still needed an Angular engineer to help figure it out.</p>
<p dir="auto">Please improve the error message to make this situation debuggable.  E.g. when the <code class="notranslate">ngIf</code> failed to produce its inner contents, the reason why seemed to get swallowed up but I bet it doesn't have to be that way.</p>
<p dir="auto">Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="102171259" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/3754" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/3754/hovercard" href="https://github.com/angular/angular/issues/3754">#3754</a> (should be fixed together)</p>
<p dir="auto">Listing an event in a directive without creating an associated <code class="notranslate">EventEmitter</code> instance results in cryptic error:</p>
<blockquote>
<p dir="auto">TypeError: Cannot read property 'observer' of undefined<br>
at Function.ObservableWrapper.subscribe (angular2.js:19403)<br>
at EventEmitterAccessor.subscribe (angular2.js:26062)<br>
at AppViewManagerUtils._setUpEventEmitters (angular2.js:20932)<br>
at AppViewManagerUtils._hydrateView (angular2.js:20896)<br>
at AppViewManagerUtils.hydrateRootHostView (angular2.js:20814)<br>
at AppViewManager.createRootHostView (angular2.js:23990)<br>
at angular2.js:13594<br>
at Zone.run (zone.js:113)<br>
at Zone.run (angular2.js:12928)<br>
at zoneBoundFn (zone.js:86)</p>
</blockquote>
<p dir="auto">To reproduce:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Directive({
    selector: '[foo]'
})
class Foo {
  @Output() foo; // not initialized to = new EventEmitter();
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Directive</span>({
    <span class="pl-s1">selector</span>: <span class="pl-s">'[foo]'</span>
})
<span class="pl-k">class</span> <span class="pl-smi">Foo</span> {
  <span class="pl-c1">@</span><span class="pl-c1">Output</span>() <span class="pl-smi">foo</span><span class="pl-s1"></span>; <span class="pl-c">// not initialized to = new EventEmitter();</span>
}</pre></div>