angular: Alpha35: Empty event expression produce cryptic error

Related: #3664 (should be fixed together)

I have a template with the following element:

<input type="file" id="picture" accept="image/*"
                           (change)="onFileSelected(f, $event)"
                           (fileread)>

On alpha 33 it worked great. On alpha35 it produces the following runtime error:

EXCEPTION: TypeError: Cannot set property 'lastInBinding' of undefined
angular2.js:13030 STACKTRACE:
angular2.js:13030 TypeError: Cannot set property 'lastInBinding' of undefined
    at Function.execute._ConvertAstIntoProtoRecords.create (http://localhost:5555/lib/angular2.js:18104:47)
    at http://localhost:5555/lib/angular2.js:17730:49
    at Array.map (native)
    at createEventRecords (http://localhost:5555/lib/angular2.js:17729:36)
    at JitProtoChangeDetector.execute.JitProtoChangeDetector._createFactory (http://localhost:5555/lib/angular2.js:17575:39)
    at new JitProtoChangeDetector (http://localhost:5555/lib/angular2.js:17567:32)
    at $__1.execute.JitChangeDetection.createProtoChangeDetector (http://localhost:5555/lib/angular2.js:10323:20)
    at http://localhost:5555/lib/angular2.js:15553:42
    at Array.map (native)
    at Function.execute.ListWrapper.map (http://localhost:5555/lib/angular2.js:6374:26)

The following modification still produces the error:

<input type="file" id="picture" accept="image/*"
                           (change)="onFileSelected(f, $event)"
                           (fileread)="">

This one works

<input type="file" id="picture" accept="image/*"
                           (change)="onFileSelected(f, $event)"
                           (fileread)="x">

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

This error is still occuring in RC1 when using something like <a (click)></a>).

(Forgot to add handler to an anchor element and Chrome spit this out)

browser_adapter.ts:88 EXCEPTION: TypeError: Cannot read property 'visitStatement' of undefined
2016-05-07 07:15:03.983 browser_adapter.ts:78 EXCEPTION: TypeError: Cannot read property 'visitStatement' of undefinedBrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
2016-05-07 07:15:03.985 browser_adapter.ts:88 EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'visitStatement' of undefined
2016-05-07 07:15:03.985 browser_adapter.ts:78 EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'visitStatement' of undefinedBrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
2016-05-07 07:15:03.985 browser_adapter.ts:78 STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:56(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
2016-05-07 07:15:03.985 browser_adapter.ts:78 Error: Uncaught (in promise): TypeError: Cannot read property 'visitStatement' of undefined
    at resolvePromise (zone.js:538)
    at PromiseCompleter.reject (zone.js:515)
    at eval (application_ref.ts:340)
    at ZoneDelegate.invoke (zone.js:323)
    at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.ts:67)
    at ZoneDelegate.invoke (zone.js:322)
    at Zone.run (zone.js:216)
    at zone.js:571
    at ZoneDelegate.invokeTask (zone.js:356)
    at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (ng_zone_impl.ts:56)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:57(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
2016-05-07 07:15:03.987 zone.js:461 Unhandled Promise rejection: Cannot read property 'visitStatement' of undefined ; Zone: angular ; Task: Promise.then ; Value: TypeError: Cannot read property 'visitStatement' of undefined(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
2016-05-07 07:15:03.989 zone.js:463 Error: Uncaught (in promise): TypeError: Cannot read property 'visitStatement' of undefined(…)consoleError @ zone.js:463_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426