Closed tamsler closed 5 years ago
Is your webcomponets.js
up to date? This sounds like https://github.com/webcomponents/webcomponentsjs/issues/180, which should be fixed in 0.6.0
I am still experiencing this issue. It's wierd though in chrome it gives me Uncaught Already registered (Polymer) prototype for element core-a11y-keys
but in safari it gives TypeError: undefined is not a function (evaluating 'Polymer.mixin')
currently I have to use this config to get any somewhat working results
{
"excludes": {
"imports": [
"polymer.html"
]
},
"strip-excludes": false
}
I should note that even though chrome spews out the already registered error my app still loads but in safari it does not do anything.
Can you update your node_modules and try again? The latest hydrolysis release should fix your issue.
I'm having a similar issue - the components all run fine before vulcanization, but then throw hundreds of errors after vulcanizing. I'm using hydrolysis 1.15, and webcomponents 0.7.11, both of which are the most current as of writing this issue.
Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered. Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: this._prepIs is not a function Uncaught SyntaxError: Unexpected token < Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught SyntaxError: Unexpected token < Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught TypeError: Cannot read property '_importsLoaded' of undefined Uncaught TypeError: Cannot read property '_importsLoaded' of undefined Uncaught Error: Expected template or null, found: [object Object] Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered. Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: this._prepIs is not a function Uncaught SyntaxError: Unexpected token < Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught SyntaxError: Unexpected token < Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function Uncaught TypeError: this._prepIs is not a function Uncaught TypeError: this._prepIs is not a function Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught Error: You tried to use polymer without loading it first. To load polymer, Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught ReferenceError: SYMBOL_ITERATOR is not defined Uncaught TypeError: Cannot read property 'instanceCount' of undefined Uncaught SyntaxError: Unexpected token < Uncaught TypeError: Cannot read property '_importsLoaded' of undefined Uncaught TypeError: Cannot read property '_importsLoaded' of undefined Uncaught Error: Expected template or null, found: [object Object]
I'm experiencing the same issue as above. "All of a sudden" vulcanized elements using gulp serve:dist
from Polymer Starter Kit project (slightly modified) gives above errors:
Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered.(anonymous function)
@ elements.vulcanized.html:12262(anonymous function)
@ elements.vulcanized.html:12273
Uncaught TypeError: this._prepIs is not a functionPolymer.Base._addFeature._registerFeatures
@ elements.vulcanized.html:17236Polymer.Base.registerCallback
@ elements.vulcanized.html:12148desugar
@ elements.vulcanized.html:12079window.Polymer
@ elements.vulcanized.html:12063(anonymous function)
@ elements.vulcanized.html:18343
Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefinedPolymer.Base._addFeature._setAttributeToProperty
@ elements.vulcanized.html:461Polymer.Base._addFeature._takeAttributesToModel
@ elements.vulcanized.html:456Polymer.Base._addFeature._marshalAttributes
@ elements.vulcanized.html:3775Polymer.Base._addFeature._initFeatures
@ elements.vulcanized.html:5245Polymer.Base.createdCallback
@ elements.vulcanized.html:135
I'm having the same problem!!!
Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered. elements.vulcanized.html:14252 Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function 2elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function 2elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 19elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 11elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 14elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 4elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function 3elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 4elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 5elements.vulcanized.html:19366 Uncaught TypeError: this._prepIs is not a function polymer-micro.html:254 Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered. polymer-micro.html:64 Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 2polymer.html:3135 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined polymer.html:3135 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined 3polymer.html:3135 Uncaught TypeError: this._prepIs is not a function 5elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined elements.vulcanized.html:12203 Uncaught TypeError: Cannot read property 'cancel' of null 7polymer.html:3135 Uncaught TypeError: this._prepIs is not a function elements.vulcanized.html:1078 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined polymer.html:3135 Uncaught TypeError: this._prepIs is not a function polymer.html:153 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined
+1
I fix it replacing every html import of my components to elements.html
And importing there the html I needed.
I know is not the best pratice but solved my problem.
@emersonbottero i dont get your solution, can you rephrase?
I think I understood @emersonbottero: I imported a html file in app/index.html When I moved that import over to elements.html instead, the error messages disappeared.
@me97esn Thanks for the clarification. I tried it and it didn't work. however, i managed to come out with a work around. I first ran gulp serve on my website. Then i copied the contents of the app folder in my project into a new folder. I then copied the contents of the .tmp folder into the same folder. Finally, I copied the bower components folder into the new folder. When i ran the serve with the contents of the new folder, it worked fine (Distribution/Server Upload ready)
It worked out for you @me97esn ? Shouldn't this be marked as a Bug or at least doc improvement?
+1. Can't put my vulcanized Polymer Starter Kit based site to work. I'm always receiving these messages:
Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered.
@vinerz I fix it replacing every html import of my components to elements.html
I think it happens when you have the same import in 2 places. It shouldn't but it happens.
@emersonbottero, I've managed to fix by removing a reference to Polymer.html that somehow resolved to another path. Maybe because I'm using symlinks.
I had a similar issue, for me it seemed to by a case mismatch:
/components/Polymer/Polymer.html
and ../polymer/polymer.html
causing it to load twice.
I had this problem as well and noticed that I had an extra "include/import" link in my index.html. I moved all of those links into elements.html and the gulp serve:dist
worked just fine again. I noticed
<!-- Because this project uses vulcanize this should be your only html import in this file otherwise
gulp vulcanizeand
gulp serve:distwill not work properly and Polymer JavaScript errors we be thrown. All other imports should go in elements.html -->
comment in the original index.html. I think this was the warning to put other <link>
's in the original index.html but to instead use elements.html.
This issue seems to be related to project layout and duplicate HTML imports. I'm happy to reopen it if provided with a reduced test case, but for now I'm going to mark this working as intended.
@PolymerCommunityBot
To replicate this error you have to have at least 4 files: A, B1, B2, C
Originaly:
Scheme resolves into 2 different paths
{A->B1,B1->C, B2->B1, A->B2, B2->C}, which leads to 2 different import sets:
{A, B1}, as well as set {A, B2, B1},
as requrements for C by two different traverse paths (A->B2)->C and (A->B2-B1)->C
resulting in single path
{A-B1, A->B2, B2->B1, B1-C}, which leads to import single set {A, B2, B1} requrement set for C
In brief, to correct this type of errors you have to remove an errorneous links like in example links between B2 and B1.
Use one simple rule:
Actually, more detailed rule
Except one root, that merges all branches
Indeed, this error is relatively hard to find, so check it out, brainer!
And happy coding!
Polymer!
There is an element for that!
--- index.html --- (C) link to /elements/elements.html link to /elements/app.html --- index.html ---
--- elements/elements.html --- (B2) link to /bower_components/polymer.html link to /elements/app.html --- elements/elements.html ---
--- elements/app.html --- (B1) link to /bower_components/polymer.html --- elements/app.html ---
--- bower_components/polymer.html --- (A) --- bower_components/polymer.html ---
`
I seem to be running into this.
This import set:
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html"/>
<link rel="import" href="bower_components/paper-toggle-button/paper-toggle-button.html"/>
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html"/>
<link rel="import" href="bower_components/paper-toast/paper-toast.html"/>
<link rel="import" href="bower_components/paper-input/paper-input.html"/>
<link rel="import" href="bower_components/paper-input/paper-textarea.html"/>
<link rel="import" href="bower_components/paper-spinner/paper-spinner.html"/>
<link rel="import" href="bower_components/paper-slider/paper-slider.html"/>
<link rel="import" href="bower_components/paper-menu/paper-menu.html"/>
<link rel="import" href="bower_components/paper-card/paper-card.html"/>
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html"/>
<link rel="import" href="bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html"/>
<link rel="import" href="bower_components/paper-button/paper-button.html"/>
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html"/>
<link rel="import" href="bower_components/paper-fab/paper-fab.html"/>
<link rel="import" href="bower_components/paper-item/paper-item.html"/>
<link rel="import" href="bower_components/paper-material/paper-material.html"/>
<link rel="import" href="bower_components/paper-progress/paper-progress.html"/>
<link rel="import" href="bower_components/paper-badge/paper-badge.html"/>
<link rel="import" href="bower_components/paper-radio-group/paper-radio-group.html"/>
<link rel="import" href="bower_components/paper-radio-button/paper-radio-button.html"/>
<link rel="import" href="bower_components/gold-email-input/gold-email-input.html"/>
<link rel="import" href="bower_components/gold-phone-input/gold-phone-input.html"/>
<link rel="import" href="bower_components/iron-form/iron-form.html"/>
<link rel="import" href="bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html"/>
<link rel="import" href="bower_components/font-roboto/roboto.html"/>
<link rel="import" href="bower_components/iron-icons/iron-icons.html"/>
<link rel="import" href="bower_components/iron-icons/image-icons.html"/>
<link rel="import" href="bower_components/iron-icons/social-icons.html"/>
<link rel="import" href="bower_components/iron-icons/editor-icons.html"/>
<link rel="import" href="bower_components/iron-icons/av-icons.html"/>
<link rel="import" href="bower_components/iron-icons/maps-icons.html"/>
<link rel="import" href="bower_components/iron-icons/communication-icons.html"/>
<link rel="import" href="polymer-elements/copyright-statement.html"/>
<link rel="import" href="polymer-elements/glyphicon-social-icons.html"/>
<link rel="import" href="bower_components/neon-animation/neon-animation.html"/>
<link rel="import" href="bower_components/marked-element/marked-element.html"/>
<link rel="import" href="bower_components/google-map/google-map.html"/>
<link rel="import" href="bower_components/google-map/google-map-marker.html"/>
<link rel="import" href="bower_components/google-map/google-map-poly.html"/>
has no duplicates but upon vulcanization, the code explodes:
Here's a live sample ---
Pre-Vulcanization: https://amphibiandisease.org/project.php?id=0082cd8e99af65028f4ec3c3910edbd4 Post-Vulcanization: https://amphibiandisease.org/project-vulcanized.php?id=0082cd8e99af65028f4ec3c3910edbd4
Full Template: https://github.com/AmphibiaWeb/amphibian-disease-tracker/blob/master/pre-vulcanize.html
Extracted <by-vulcanize>
node: https://raw.githubusercontent.com/AmphibiaWeb/amphibian-disease-tracker/master/modular/vulcanized-div-and-dom-module.html
@tigerhawkvok You might have solved this by now - but that issue is due to polymer.html being included more than once. You're including it at the top of your script, and then some/all of the components will be including it too.
Because Vulcanize simply inline's every include, polymer.html get's included more than once and therefore errors. You can exclude it from the vulcanize process, and keep it as an include.
@TomFoyster thanks for the note, I know it was ages ago but my tests have been failing for hours with really obscure messages and the culprit was as you say duplicate inclusion of polymer.html
I am trying to get vulcanize to work but am having very little luck. I have a bunch of components:
and am using: vulcanize index.html
... to generate vulcanized.html.
When I then use vulcanized.html, i am getting the following errors:
What am I doing wrong?