Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

NgRepeat compiled to JS throws NullError  #1097

Closed
@ufoscout

Description

@ufoscout

We are preparing a Sortable component for the next version of the Angular UI library (https://pub.dartlang.org/packages/angular_ui).
It works fine in Dartium, but when compiled to JS, the NgRepeat directive often throws a NullError.
Here the error stack in Chrome:

TypeError: Cannot read property 'set$_childHead' of null
    at Scope.destroy$0 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11797:26)
    at NgRepeat__onChange_closure2.call$1 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15937:23)
    at _CollectionChangeRecord.forEachRemoval$1 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:53360:11)
    at NgRepeat._onChange$1 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15802:17)
    at NgRepeat_expression_closure0.call$2 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15886:19)
    at Watch.reactionFn$2 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24887:30)
    at Watch.invoke$0 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24897:12)
    at RootWatchGroup.detectChanges$5$changeLog$evalStopwatch$exceptionHandler$fieldStopwatch$processStopwatch (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24835:26)
    at RootScope.digest$0 (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:12110:34)
    at RootScope.<anonymous> (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11750:12)
    at RootScope.Scope.apply$2 [as apply$0] (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11756:19)
    at eval [as call$0] (eval at <anonymous> (http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:3172:14), <anonymous>:2:37) 

And here the staketrace in FF (similar but not the same):

NullError: this._parentScope is null

STACKTRACE:
.Scope.destroy$0<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11797
.NgRepeat__onChange_closure2.call$1<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15937
._CollectionChangeRecord.forEachRemoval$1@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:53360
.NgRepeat._onChange$1<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15802
.NgRepeat_expression_closure0.call$2<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:15886
.Watch.reactionFn$2@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24887
.Watch.invoke$0@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24897
.RootWatchGroup.detectChanges$5$changeLog$evalStopwatch$exceptionHandler$fieldStopwatch$processStopwatch@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:24835
.RootScope.digest$0<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:12110
.Scope.apply$2<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11750
.Scope.apply$2<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:11756
anonymous/<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:3172
._rootRun<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:28762
._ZoneDelegate.run$2@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:31478
.VmTurnZone._finishTurn$2<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:12917
.VmTurnZone._onRunBase$4<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:12883
.VmTurnZone._onRunUnary$5<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:12890
anonymous/<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:3184
._ZoneDelegate.runUnary$3@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:31485
._CustomizedZone.runUnary$2@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:31668
._BaseZone.runUnaryGuarded$2@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:31568
._BaseZone_bindUnaryCallback_closure.call$1<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:31626
.invokeClosure_closure0.call$0@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:4358
._IsolateContext.eval$1<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:1833
._callInIsolate@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:1466
.invokeClosure<@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:3017
.convertDartClosureToJS/$function@http://127.0.0.1:3030/angular.dart.ui/build/web/main.dart.js:3036

To reproduce the issue, checkout the dragdrop branch (https://github.com/akserg/angular.dart.ui/tree/dragdrop) and compile it to JS (pub build). Open the build result in a browser, drag of an element of a sortable list performing fast movements with the mouse. The exception is thrown multiple times and the content of the list is corrupted.
As stated before, everything works perfectly with Dart code in Dartium.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions