PolymerElements / paper-checkbox

A Material Design checkbox
https://www.webcomponents.org/element/PolymerElements/paper-checkbox
58 stars 62 forks source link

paper-checkbox causes polymer-starter-kit new view to crash on import #195

Closed PeterZhizhin closed 6 years ago

PeterZhizhin commented 6 years ago

Description

The paper-checkbox element causes whole components to crash at import with the following message in the console:

Error: A custom element with name 'iron-meta' has already been defined.

I am trying to complete this guide on the official Polymer website: https://www.polymer-project.org/3.0/start/toolbox/add-elements. The import causes my-new-view to crash and results in missing content for the whole component while other views still work fine. Disabling the import results in missing checkbox but the component is present.

Expected outcome

Checkbox appeared in the component.

Actual outcome

The whole component using paper-checkbox is missing.

Steps to reproduce

  1. Complete steps in the guide: https://www.polymer-project.org/3.0/start/toolbox/set-up
  2. Step 3 fails with the following code for my-new-view.js:
    
    import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
    import '@polymer/paper-checkbox/paper-checkbox.js';
    import './shared-styles.js';

class MyNewView extends PolymerElement { static get template() { return html`

        <div class="card">
            <h1>New View!</h1>
            <paper-checkbox>Ready to deploy!</paper-checkbox>
            <p>New view!</p>
        </div>
    `;
}   

}

window.customElements.define('my-new-view', MyNewView);



### Browsers Affected
- [x] Chrome
- [x] Firefox
- [x] Safari 9

### Related links

There is also the same unanswered question on StackOverflow: https://stackoverflow.com/questions/51046158/issue-importing-polymer-elements
Plutonium94 commented 6 years ago

npm update solves the issue.

neo7BF commented 6 years ago

It's a problem of duplicate dependencies - Deleting the node_modules folder and package-lock.json and running npm i fixed it