Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Vulcanize generated file generates lots of errors #1751

Closed tamsler closed 5 years ago

tamsler commented 9 years ago

I am trying to get vulcanize to work but am having very little luck. I have a bunch of components:

    <link rel="import" href="./components/core-toolbar/core-toolbar.html">
    <link rel="import" href="./components/core-pages/core-pages.html">
    <link rel="import" href="./components/core-menu/core-menu.html">
    <link rel="import" href="./components/core-menu/core-submenu.html">
    <link rel="import" href="./components/core-item/core-item.html">
    <link rel="import" href="./components/core-scaffold/core-scaffold.html">
    <link rel="import" href="./components/core-icons/core-icons.html">
    <link rel="import" href="./components/core-icons/communication-icons.html">
    <link rel="import" href="./components/core-icon-button/core-icon-button.html">
    <link rel="import" href="./components/core-animation/core-animation.html">
    <link rel="import" href="./components/core-tooltip/core-tooltip.html">
    <link rel="import" href="./components/core-media-query/core-media-query.html">
    <link rel="import" href="./components/paper-tabs/paper-tabs.html">
    <link rel="import" href="./elements/ucd-aggiefeed-validate-auth.html">
    <link rel="import" href="./elements/ucd-aggiefeed-source-filter.html">
    <link rel="import" href="./elements/ucd-aggiefeed-events.html">

and am using: vulcanize index.html

... to generate vulcanized.html.

When I then use vulcanized.html, i am getting the following errors:

Uncaught TypeError: flags.log.split is not a function(anonymous function) @ webcomponents.js:30(anonymous function) @ webcomponents.js:52
polymer.js:6384 Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.(anonymous function) @ polymer.js:6384(anonymous function) @ polymer.js:6389(anonymous function) @ polymer.js:7507
core-meta.html:68 Uncaught TypeError: Polymer is not a function(anonymous function) @ core-meta.html:68(anonymous function) @ core-meta.html:142
core-iconset.html:67 Uncaught TypeError: Polymer is not a function(anonymous function) @ core-iconset.html:67
core-iconset-svg.html:56 Uncaught TypeError: Polymer is not a function(anonymous function) @ core-iconset-svg.html:56
core-icon.html:70 Uncaught TypeError: Polymer is not a function(anonymous function) @ core-icon.html:70(anonymous function) @ core-icon.html:200
vulcanized.html:528 Uncaught TypeError: Polymer.mixin is not a function(anonymous function) @ vulcanized.html:528(anonymous function) @ vulcanized.html:664
vulcanized.html:1138 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:1138(anonymous function) @ vulcanized.html:1199
vulcanized.html:1206 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:1206
vulcanized.html:1288 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:1288
vulcanized.html:1796 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:1796
vulcanized.html:2004 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2004(anonymous function) @ vulcanized.html:2046
vulcanized.html:2079 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2079
vulcanized.html:2089 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2089(anonymous function) @ vulcanized.html:2163
vulcanized.html:2171 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2171
vulcanized.html:2401 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2401(anonymous function) @ vulcanized.html:2531
vulcanized.html:2591 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2591
vulcanized.html:2630 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2630
vulcanized.html:2931 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2931
vulcanized.html:2986 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:2986
vulcanized.html:3212 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:3212
vulcanized.html:3629 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:3629
vulcanized.html:3817 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:3817
vulcanized.html:4258 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:4258
vulcanized.html:4359 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:4359
vulcanized.html:4534 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:4534(anonymous function) @ vulcanized.html:4914
vulcanized.html:4931 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:4931
vulcanized.html:4966 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:4966
polymer-mixin.js:7 Uncaught TypeError: Polymer.mixin is not a functionPolymer.mixin2 @ polymer-mixin.js:7(anonymous function) @ vulcanized.html:5225(anonymous function) @ vulcanized.html:5228
vulcanized.html:5445 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:5445(anonymous function) @ vulcanized.html:5635
polymer-mixin.js:7 Uncaught TypeError: Polymer.mixin is not a functionPolymer.mixin2 @ polymer-mixin.js:7(anonymous function) @ vulcanized.html:5773(anonymous function) @ vulcanized.html:5776
vulcanized.html:5821 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:5821
vulcanized.html:5934 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:5934
vulcanized.html:6074 Uncaught TypeError: Polymer.mixin is not a function(anonymous function) @ vulcanized.html:6074
vulcanized.html:6319 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:6319
vulcanized.html:6410 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:6410
vulcanized.html:6821 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:6821
vulcanized.html:7035 Uncaught TypeError: Polymer.mixin is not a function(anonymous function) @ vulcanized.html:7035(anonymous function) @ vulcanized.html:8158
vulcanized.html:8174 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8174(anonymous function) @ vulcanized.html:8235
vulcanized.html:8368 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8368
vulcanized.html:8618 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8618
vulcanized.html:8647 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8647
vulcanized.html:8716 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8716
vulcanized.html:8743 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:8743(anonymous function) @ vulcanized.html:8823
vulcanized.html:8830 Uncaught TypeError: Polymer.mixin is not a function(anonymous function) @ vulcanized.html:8830(anonymous function) @ vulcanized.html:9484
vulcanized.html:9539 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:9539
vulcanized.html:9754 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:9754(anonymous function) @ vulcanized.html:9931
vulcanized.html:9983 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:9983
vulcanized.html:10214 Uncaught TypeError: Polymer is not a function(anonymous function) @ vulcanized.html:10214

What am I doing wrong?

dfreedm commented 9 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

ChrisMcKenzie commented 9 years ago

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.

garlicnation commented 9 years ago

Can you update your node_modules and try again? The latest hydrolysis release should fix your issue.

ghost commented 9 years ago

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]

Gifgroen commented 9 years ago

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
emersonbottero commented 9 years ago

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

me97esn commented 9 years ago

+1

emersonbottero commented 9 years ago

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.

Delanyo32 commented 9 years ago

@emersonbottero i dont get your solution, can you rephrase?

me97esn commented 9 years ago

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.

Delanyo32 commented 9 years ago

@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)

emersonbottero commented 9 years ago

It worked out for you @me97esn ? Shouldn't this be marked as a Bug or at least doc improvement?

vinerz commented 9 years ago

+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.
emersonbottero commented 9 years ago

@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.

vinerz commented 9 years ago

@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.

avdaredevil commented 8 years ago

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.

jeffrey-l-turner commented 8 years ago

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 otherwisegulp vulcanizeandgulp 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.

garlicnation commented 8 years ago

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.

github-polymer-user commented 8 years ago

@PolymerCommunityBot

The common point: you are in trouble

You are vulcanized

To replicate this error you have to have at least 4 files: A, B1, B2, C

Step 1. You've got different traverse paths to C

Originaly:

scheme1

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

Step 2: Fix different traverse paths to C

scheme2

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.

Prevent this error from appering

Use one simple rule:

A tree

Actually, more detailed rule

There is no branchs that merges

Except one root, that merges all branches

Indeed, this error is relatively hard to find, so check it out, brainer!

And happy coding!

There is one root to rule them all

Polymer!

It came to me, my own, my love, my own, my precious!

There is an element for that!

--Rob Dodson

Supplemential materials:

--- 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 ---

`

tigerhawkvok commented 8 years ago

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:

image

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

TomFoyster commented 8 years ago

@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.

breenie commented 7 years ago

@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