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

"The null object does not have a method '_badUpgrade'." in 1.0.0.rc-5 #634

Closed zoechi closed 8 years ago

zoechi commented 8 years ago

Since the update I repeatedly get

Uncaught Unhandled exception: The null object does not have a method '_badUpgrade'.

NoSuchMethodError: method not found: '_badUpgrade' Receiver: null Arguments: []

0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)

1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)

2 _createCustomUpgrader (dart:html:1237)

3 _VMElementUpgrader.upgrade (dart:html:47395)

4 registerDartType.upgradeElement (package:web_components/interop.dart:38:45)

5 JsObject._callMethod (dart:js:1124)

6 JsNative.callMethod (dart:js:1136)

7 Blink_JsNative_DomException.callMethod (dart:_blink:17259)

8 BlinkDocument.createElement_Callback1 (dart:_blink:3330)

9 Document.createElement (dart:html:11031)

10 _ElementFactoryProvider.createElement_tag (dart:html:16361)

11 Element.Element.tag (dart:html:13878)

12 AllDemos._loadDemo (http://localhost:63342/polymer_elements_demos/web/all_demos.dart:284:22)

13 AllDemos.selectedItemChanged (http://localhost:63342/polymer_elements_demos/web/all_demos.dart:277:9)

14 Function._apply (dart:core-patch/function_patch.dart:7)

15 Function.apply (dart:core-patch/function_patch.dart:28)

16 _InstanceMirrorImpl.invoke (package:reflectable/src/reflectable_transformer_based.dart:164:23)

17 _setupReflectableMethods.. (package:polymer/src/common/polymer_descriptor.dart:162:31)

(anonymous function)
newCallback
(anonymous function)
(anonymous function)
Polymer.Base.extend._observerEffect
(anonymous function)
Polymer.Bind._modelApi._effectEffects

Dart VM version: 1.13.0-edge.05ad578b77d074bf620227bcf5a3e5f53c28cc32 (Fri Oct 30 14:53:19 2015) on "linux_x64"

zoechi commented 8 years ago

I could narrow down a bit. It seems I only get this exception for some Google API components in https://github.com/bwu-dart/polymer_elements_demos/tree/update_2015-11-01 when I load web/index.html and select one of the following demos:

zoechi commented 8 years ago

I run into this _badUpgrade today when an event handler Listen('theme-changed') myHandler(_, __){ throw 'xxx'; } failed with an exception.

jakemac53 commented 8 years ago

This is definitely a weird one, looks like it happens when you create a new element dynamically in code and then the upgrader fails.

jakemac53 commented 8 years ago

It doesn't fail on the initial creation either, just subsequent ones?

jakemac53 commented 8 years ago

cc @terrylucas since this looks like its happening inside the vm upgrader

jakemac53 commented 8 years ago

So really what is happening here is an error is being thrown during the construction of the element, and the error is just being hidden by the separate error in dartium.

I tracked it down to a bad splices change notification, which has a null indexSplices property. I can't actually repro this outside of these couple elements, definitely going to need further investigation.

terrylucas commented 8 years ago

bleeding edge in Dartium has the fix to return the real error.

jakemac53 commented 8 years ago

@zoechi can you confirm that this is now giving you a better error at least?

zoechi commented 8 years ago

Yup, proper stacktrace :+1:

jakemac53 commented 8 years ago

Ok, I am going to close this one then, and you can open a new issue for the actual error? Or maybe link it here if already filed :)

avstudios commented 8 years ago

I also see that exception in stable 1.13.0.0 dartium. Any advice how to make it work?