Polymer / tools

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

Directory Structure for Child Elements #2258

Open bennypowers opened 8 years ago

bennypowers commented 8 years ago

Description

When building an element which uses child elements, with this directory structure, polymer-cli fails to render demos.

screen shot 2016-09-24 at 8 45 22 pm

Versions & Environment

$ polymer --version
0.16.0
$ node --version
v6.6.0
$ sw_vers -productVersion                                                                                                                                                                                           
10.11.6

Steps to Reproduce

polymer serve.

Expected Results

Docs and Demo links should appear in parent element toolbar. Demo should work

Actual Results

No Docs or demo link in parent elem, only in child elements (when selected by toolbar). Demo fails.

Parent element page

screen shot 2016-09-24 at 9 09 14 pm

Child element page (selected from drop down)

screen shot 2016-09-24 at 9 09 29 pm

Console output when clicking on 'demo' for a child element.

polymer-micro.html:363 Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered.(anonymous function) @ polymer-micro.html:363(anonymous function) @ polymer-micro.html:378
polymer-micro.html:71 Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a functiondesugar @ polymer-micro.html:71window.Polymer @ polymer-micro.html:58(anonymous function) @ polymer.html:4070(anonymous function) @ polymer.html:4172
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-request.html:24
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-ajax.html:42
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-toolbar.html:293
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-ripple.html:438(anonymous function) @ paper-ripple.html:757
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-button.html:149
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-meta.html:63(anonymous function) @ iron-meta.html:332
polymer-micro.html:630 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined_setAttributeToProperty @ polymer-micro.html:630_attributeChangedImpl @ polymer.html:1974attributeChangedCallback @ polymer-micro.html:238create @ polymer.html:1379(anonymous function) @ iron-icon.html:145
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-icon.html:107
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-icon-button.html:127
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-fab.html:129
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-a11y-announcer.html:64(anonymous function) @ iron-a11y-announcer.html:121
polymer-micro.html:71 Uncaught TypeError: Polymer.Base._getExtendedPrototype is not a functiondesugar @ polymer-micro.html:71window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-input.html:51
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-input-char-counter.html:58
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-input-container.html:343
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-input-error.html:61
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-input.html:162
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-overlay-backdrop.html:62(anonymous function) @ iron-overlay-backdrop.html:166
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ opaque-animation.html:22
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-dropdown.html:71(anonymous function) @ iron-dropdown.html:345
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ fade-in-animation.html:30
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ fade-out-animation.html:30
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-menu-button-animations.html:15
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-menu-button.html:148(anonymous function) @ paper-menu-button.html:477
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ iron-iconset-svg.html:50
iron-iconset-svg.html:135 Uncaught TypeError: Polymer.IronMeta is not a constructor_nameChanged @ iron-iconset-svg.html:135_observerEffect @ polymer.html:1606_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433__setProperty @ polymer.html:1442_applyConfig @ polymer.html:2054_afterClientsReady @ polymer.html:2048_ready @ polymer-mini.html:74_tryReady @ polymer-mini.html:60_initFeatures @ polymer.html:4053createdCallback @ polymer-micro.html:202
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-dropdown-menu.html:127(anonymous function) @ paper-dropdown-menu.html:404
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-icon-item.html:78
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-item.html:103
4iron-iconset-svg.html:135 Uncaught TypeError: Polymer.IronMeta is not a constructor_nameChanged @ iron-iconset-svg.html:135_observerEffect @ polymer.html:1606_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433__setProperty @ polymer.html:1442_applyConfig @ polymer.html:2054_afterClientsReady @ polymer.html:2048_ready @ polymer-mini.html:74_tryReady @ polymer-mini.html:60_initFeatures @ polymer.html:4053createdCallback @ polymer-micro.html:202
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-listbox.html:83(anonymous function) @ paper-listbox.html:94
iron-iconset-svg.html:135 Uncaught TypeError: Polymer.IronMeta is not a constructor_nameChanged @ iron-iconset-svg.html:135_observerEffect @ polymer.html:1606_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433__setProperty @ polymer.html:1442_applyConfig @ polymer.html:2054_afterClientsReady @ polymer.html:2048_ready @ polymer-mini.html:74_tryReady @ polymer-mini.html:60_initFeatures @ polymer.html:4053createdCallback @ polymer-micro.html:202
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ paper-swatch-picker.html:137
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-cursor-reset.html:25
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-cursor.html:25
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-font-decrease.html:24
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-font-increase.html:25
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-font-reset.html:25
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-font-simple.html:24
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-high-contrast.html:34
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-l10n.html:34
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-underline-links.html:21
polymer-micro.html:187 Uncaught TypeError: this._desugarBehaviors is not a functionregisterCallback @ polymer-micro.html:187desugar @ polymer-micro.html:74window.Polymer @ polymer-micro.html:58(anonymous function) @ ux-a11y-widget.html:210
2polymer-micro.html:630 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined_setAttributeToProperty @ polymer-micro.html:630_attributeChangedImpl @ polymer.html:1974attributeChangedCallback @ polymer-micro.html:238instanceTemplate @ polymer-mini.html:31_stampTemplate @ polymer-mini.html:27_initFeatures @ polymer.html:4045createdCallback @ polymer-micro.html:202
polymer-micro.html:630 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined_setAttributeToProperty @ polymer-micro.html:630_attributeChangedImpl @ polymer.html:1974attributeChangedCallback @ polymer-micro.html:238_disabledChanged @ iron-control-state.html:89_observerEffect @ polymer.html:1606_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433__setProperty @ polymer.html:1442_applyConfig @ polymer.html:2054_afterClientsReady @ polymer.html:2048_ready @ polymer-mini.html:74_readyClients @ polymer-mini.html:82_ready @ polymer-mini.html:70_tryReady @ polymer-mini.html:60_initFeatures @ polymer.html:4053createdCallback @ polymer-micro.html:202
2polymer-micro.html:630 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined_setAttributeToProperty @ polymer-micro.html:630_attributeChangedImpl @ polymer.html:1974attributeChangedCallback @ polymer-micro.html:238applyElementScopeSelector @ polymer.html:3647_applyStyleProperties @ polymer.html:3950_updateStyleProperties @ polymer.html:3903_beforeAttached @ polymer.html:3865attachedCallback @ polymer-mini.html:103insertBefore @ polymer-mini.html:562_updateChildNodes @ polymer-mini.html:1890_composeTree @ polymer-mini.html:1846_finishDistribute @ polymer-mini.html:1767_readyClients @ polymer-mini.html:85_ready @ polymer-mini.html:70_tryReady @ polymer-mini.html:60_initFeatures @ polymer.html:4053createdCallback @ polymer-micro.html:202
polymer-micro.html:630 Uncaught TypeError: Cannot read property 'dashToCamelCase' of undefined_setAttributeToProperty @ polymer-micro.html:630_attributeChangedImpl @ polymer.html:1974attributeChangedCallback @ polymer-micro.html:238applyElementScopeSelector @ polymer.html:3647_applyStyleProperties @ polymer.html:3950_updateStyleProperties @ polymer.html:3903_beforeAttached @ polymer.html:3865attachedCallback @ polymer-mini.html:103
marked.js:1227 Uncaught TypeError: Cannot read property 'node' of undefined
Please report this to https://github.com/chjj/marked.fire @ polymer.html:1277_highlight @ marked-element.html:217Renderer.code @ marked.js:766Parser.tok @ marked.js:990Parser.parse @ marked.js:935Parser.parse @ marked.js:922marked @ marked.js:1219render @ marked-element.html:212_observerEffect @ polymer.html:1606_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433__setProperty @ polymer.html:1442_applyEffectValue @ polymer.html:1927_annotationEffect @ polymer.html:1590_effectEffects @ polymer.html:1449_propertySetter @ polymer.html:1433setter @ polymer.html:1512attached @ demo-snippet.html:146_invokeBehavior @ polymer-micro.html:455_doBehavior @ polymer-micro.html:445(anonymous function) @ polymer-micro.html:227_makeReady @ polymer-micro.html:115(anonymous function) @ polymer-micro.html:121(anonymous function) @ timeline.js:21requestAnimationFrame (async)window.requestAnimationFrame @ timeline.js:19_catchFirstRender @ polymer-micro.html:120(anonymous function) @ polymer-micro.html:167checkDone @ webcomponents-lite.js:1212loadedImport @ webcomponents-lite.js:1223
marked.js:1227 Uncaught TypeError: Cannot read property 'node' of undefined
Please report this to https://github.com/chjj/marked.fire @ polymer.html:1277_highlight @ marked-element.html:217Renderer.code @ marked.js:766Parser.tok @ marked.js:990Parser.parse @ marked.js:935Parser.parse @ marked.js:922marked @ marked.js:1219render @ marked-element.html:212attached @ marked-element.html:159_invokeBehavior @ polymer-micro.html:455_doBehavior @ polymer-micro.html:445(anonymous function) @ polymer-micro.html:227_makeReady @ polymer-micro.html:115(anonymous function) @ polymer-micro.html:121(anonymous function) @ timeline.js:21requestAnimationFrame (async)window.requestAnimationFrame @ timeline.js:19_catchFirstRender @ polymer-micro.html:120(anonymous function) @ polymer-micro.html:167checkDone @ webcomponents-lite.js:1212loadedImport @ webcomponents-lite.js:1223
:8080/service-worker.js:1 The script has an unsupported MIME type ('text/html').
:8080/service-worker.js:1 GET http://localhost:8080/service-worker.js net::ERR_INSECURE_RESPONSE
OrenBochman commented 8 years ago

Where did you get this folder setup ? The demo pages are created using iron-component-page and iron-demo-helpers + polymer-analyzer AKA hydrolysis. Expects a flat structure (I've used one folder per components or one folder for all components. So try to put all the components folders side by side?

bennypowers commented 8 years ago

I have one parent elem which acts as a container for all the children. I've had limited success packing it up for distribution. using a flat folder structure is breaking element loading on unsupported browsers and demos.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.