dart-archive / polymer-dart

Polymer support for Dart
https://pub.dartlang.org/packages/polymer
BSD 3-Clause "New" or "Revised" License
181 stars 33 forks source link

Weird exception in Firefox with Dart Polymer 1.0.0-rc.17 application #701

Open anders-sandholm opened 8 years ago

anders-sandholm commented 8 years ago

From @zoechi on June 5, 2016 13:45

dart<.wrapException() checkbox_row_select.bootstrap.initialize.dart.js:2468 dart<._rootHandleUncaughtError_closure.call$0() checkbox_row_select.bootstrap.initialize.dart.js:11383 dart<._microtaskLoop() checkbox_row_select.bootstrap.initialize.dart.js:9655 dart<._startMicrotaskLoop<() checkbox_row_select.bootstrap.initialize.dart.js:9661 dart<._AsyncRun__initializeScheduleImmediate_internalCallback.call$1<() checkbox_row_select.bootstrap.initialize.dart.js:9868 dart<.invokeClosure_closure0.call$0() checkbox_row_select.bootstrap.initialize.dart.js:3617 dart<._IsolateContext.eval$1() checkbox_row_select.bootstrap.initialize.dart.js:1617 dart<._callInIsolate() checkbox_row_select.bootstrap.initialize.dart.js:1269 dart<.invokeClosure<() checkbox_row_select.bootstrap.initialize.dart.js:2618 dart<.convertDartClosureToJS/$function</<() checkbox_row_select.bootstrap.initialize.dart.js:2637 n() webcomponents.min.js:11 t() webcomponents.min.js:11 checkbox_row_select.bootstrap.initialize.dart.js:2468:17

Code at 2468 is

    wrapException: function(ex) {
      var wrapper;
      if (ex == null)
        ex = new P.NullThrownError();
      wrapper = new Error(); // <<<<<====== exception
      wrapper.dartException = ex;
      if ("defineProperty" in Object) {
        Object.defineProperty(wrapper, "message", {get: H.toStringWrapper});
        wrapper.name = "";
      } else
        wrapper.toString = H.toStringWrapper;
      return wrapper;
    },

when running this example https://github.com/bwu-dart/bwu_datagrid/blob/6f3034988753b348563e94dc79cc2401dadbc18a/example_/web/checkbox_row_select.html

any hint about how to debug or what could cause this issue?

Dart VM version: 1.17.0-edge.b37747934e762dbb4973ddd8798c4ca6126f5f24 (Fri Jun 3 15:14:30 2016) on "linux_x64"

The issue seems to exist for quite some time and is not related to a recent Dart update.

Copied from original issue: dart-lang/sdk#26622

anders-sandholm commented 8 years ago

From @zoechi on June 5, 2016 13:46

Firefox 45.1.1

Linux zdev 4.5.0-2-amd64 #1 SMP Debian 4.5.4-1 (2016-05-16) x86_64 GNU/Linux

anders-sandholm commented 8 years ago

From @zoechi on June 5, 2016 16:39

Seems to be caused by dom-repeat

    <ul>
      <template is="dom-repeat" items="{{columnCheckboxes}}" as="col">
      </template>
    </ul>

Leaving the plain <template> tag without is="dom-repeat" items="{{columnCheckboxes}}" as="col" the error is gone.

anders-sandholm commented 8 years ago

From @zoechi on June 6, 2016 5:11

The code is from https://github.com/bwu-dart/bwu_datagrid/blob/1656186567358b77fbe4567ed33277eae9e83273/lib/components/bwu_column_picker/bwu_column_picker.html#L56 It's not related to <template> inside <ul>. If I remove everything from the template except the <template is="dom-repeat"></template> I get the error.

zoechi commented 8 years ago

I was able to get some more information from Firefox (don't have experience debugging with it)

image

zoechi commented 8 years ago

I also found

element is not subclass of TemplateElement

in the DartException class. Is it the same as #682 then?