Search code examples
firebasepolymer-1.0firebase-hostingfirebase-polymer

Polygit doesn't import elements when deployed to firebase


I watched the Polymer Submit which inspired me to build a Web App with Polymer and firebase and to import elements I wanted to use Polygit, so I "wrote" a little code.

When I open the index.html file in directly in my browser, it all worked well, but when I deploy my app to firebase, I can only see my text on a white background and the polymer elements aren't interpretated as such.

Here are my imports I declared in the <head> - Tag:

<base href="http://polygit.org/polymer+:master/components/">
<link href="polymer/polymer.html" rel="import">
<link href="paper-drawer-panel/paper-drawer-panel.html" rel="import">
<link href="paper-header-panel/paper-header-panel.html" rel="import">
<link href="paper-toolbar/paper-toolbar.html" rel="import">
<link href="paper-icon-button/paper-icon-button.html" rel="import">

And here is my <body class="fullbleed layout vertical"> - Tag:

  <paper-drawer-panel class="flex">
    <paper-header-panel drawer>
      <paper-toolbar>
      </paper-toolbar>
    <div> Drawer content... </div>
  </paper-header-panel>
  <paper-header-panel main>
    <paper-toolbar>
      <paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button>
      <div>Social Contacts</div>
    </paper-toolbar>
    <div> Main content... </div>
  </paper-header-panel>
</paper-drawer-panel>

Solution

  • As Firebase-App run under the https-Protocol you have to import under the https protocol as well, so you have to change this line:

    <base href="http://polygit.org/polymer+:master/components/">
    

    to this line:

    <base href="https://polygit.org/polymer+:master/components/">
    

    Notice that I added the 's' to 'http'