Open ghost opened 9 years ago
This is probably happening because of an html import to the wrong packages
folder. The rules for this are somewhat complicated, I would reference this doc https://www.dartlang.org/polymer-old/app-directories.html#importing-assets.
Interesting that in this project (link in the comments) only produces this errors in device mode http://stackoverflow.com/questions/33242044/error-on-changing-to-device-mode-already-have-a-dart-type-associated
I have had the same problem using polymer-dart 1.0. I have striped it down to a single page app and hosted on github https://github.com/cbobach/spa_error. The errors is only there in device mode. Hope it can cast some light over the problem.
Reconstruct polymer-dart spa errors in device mode
See .yaml file for versions, using dart version: 1.13.0-dev.7.2, chromium version: 45.0.2454.101 Ubuntu 15.10
ERROR: interop_support.js:72 Already have a Dart type associated with iron-media-query interop_support.js:72 Already have a Dart type associated with iron-selector interop_support.js:72 Already have a Dart type associated with paper-drawer-panel interop_support.js:72 Already have a Dart type associated with paper-item interop_support.js:72 Already have a Dart type associated with paper-menu interop_support.js:72 Already have a Dart type associated with iron-meta interop_support.js:72 Already have a Dart type associated with iron-meta-query interop_support.js:72 Already have a Dart type associated with iron-icon interop_support.js:72 Already have a Dart type associated with iron-iconset-svg interop_support.js:72 Already have a Dart type associated with opaque-animation interop_support.js:72 Already have a Dart type associated with neon-animatable interop_support.js:72 Already have a Dart type associated with neon-animated-pages interop_support.js:72 Already have a Dart type associated with slide-left-animation interop_support.js:72 Already have a Dart type associated with slide-from-right-animation interop_support.js:72 Already have a Dart type associated with array-selector interop_support.js:72 Already have a Dart type associated with dom-bind interop_support.js:72 Already have a Dart type associated with dom-if interop_support.js:72 Already have a Dart type associated with dom-repeat js_helper.dart:1697 Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'main-app'. A type with that name is already registered.
On Dartium, when using screen resolution, I confirmed error console messages below at polymer-spa-example and my own app with latest polymer(0.16.1+2) and paper/core- element(0.7.0).
Here is the console message.
interop_support.js:72 Already have a Dart type associated with core-a11y-keys interop_support.js:72 Already have a Dart type associated with core-selection interop_support.js:72 Already have a Dart type associated with core-selector interop_support.js:72 Already have a Dart type associated with core-animated-pages interop_support.js:72 Already have a Dart type associated with core-meta interop_support.js:72 Already have a Dart type associated with core-iconset interop_support.js:72 Already have a Dart type associated with core-icon interop_support.js:72 Already have a Dart type associated with core-iconset-svg interop_support.js:72 Already have a Dart type associated with core-icon-button interop_support.js:72 Already have a Dart type associated with core-menu interop_support.js:72 Already have a Dart type associated with core-toolbar interop_support.js:72 Already have a Dart type associated with core-media-query interop_support.js:72 Already have a Dart type associated with core-drawer-panel interop_support.js:72 Already have a Dart type associated with core-header-panel interop_support.js:72 Already have a Dart type associated with core-scaffold interop_support.js:72 Already have a Dart type associated with paper-ripple interop_support.js:72 Already have a Dart type associated with paper-button-base interop_support.js:72 Already have a Dart type associated with paper-item undefined:1 Exception: Uncaught Error: Already registered (Polymer) prototype for element core-xhr-dart Stack Trace: JsFunction.apply (dart:js:254) Polymer.register (package:polymer/src/instance.dart:169:48) CustomTag.initialize (package:polymer/src/initializers.dart:12:41) loadInitializers.. (package:initialize/src/static_loader.dart:46:42)
_runInitQueue (package:initialize/initialize.dart:35:24)
run (package:initialize/initialize.dart:27:23)
run (package:web_components/src/static_initializer.dart:15:13)
initWebComponents. (package:web_components/src/init.dart:28:38)
_RootZone.runUnary (dart:async/zone.dart:1155)
_Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:484)
_Future._propagateToListeners (dart:async/future_impl.dart:567)
_Future._completeWithValue (dart:async/future_impl.dart:358)
_Future._asyncComplete. (dart:async/future_impl.dart:412)
_asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
_asyncRunCallback (dart:async/schedule_microtask.dart:48)
_handleMutation (dart:html:42316)
(Update) I do apologize several refereneces are accidentally created by this post.