title: How to import an npm package into Polymer 3
body: <p>I often find packages on npm that I want to include in a Polymer3 element.</p>
  
  <p>the instructions to install the package are often to use npm with something like <code>npm install fingerprintjs2</code></p>
  
  <p>Below I included the basic Polymer 3 elementas an example. but i get the error</p>
  
  <p><code>Uncaught TypeError: Cannot read property 'exports' of undefined</code></p>
  
  <p>I dont understand how I should import from <a href="https://github.com/Valve/fingerprintjs2" rel="nofollow noreferrer">https://github.com/Valve/fingerprintjs2</a></p>
  
  <pre><code>import {html, PolymerElement} from '@polymer/polymer/polymer-element.js';
  import './node_modules/fingerprintjs2/dist/fingerprint2.min.js';
  class FingerPrint extends PolymerElement {
    static get template() {
      return html`
        &lt;style&gt;
          :host {display: block;}
        &lt;/style&gt;
        &lt;h2&gt;Finger Print&lt;/h2&gt;
      `;
    }
    ready() {
      super.ready();
      setTimeout(function () {
        Fingerprint2.get(function (components) {
          console.log(components)
        })  
    }, 5000)
    }
  } window.customElements.define('finger-print', FingerPrint);
  </code></pre>
  
  <p>if I try to import it with </p>
  
  <pre><code>import Fingerprint2 from './node_modules/fingerprintjs2/dist/fingerprint2.min.js';
  </code></pre>
  
  <p>then I get the error <code>Uncaught SyntaxError: The requested module '../fingerprintjs2/dist/fingerprint2.min.js' does not provide an export named 'default'</code></p>
  
  <p>I also tried</p>
  
  <pre><code>import {Fingerprint2} from './node_modules/fingerprintjs2/dist/fingerprint2.min.js';
  </code></pre>
  
  <p>and get <code>Uncaught SyntaxError: The requested module '../fingerprintjs2/dist/fingerprint2.min.js' does not provide an export named 'Fingerprint2'</code></p>