2015-10-22 12 views
5

複数のカスタムコンポーネントを使用してChromeにサイトを構築したところ、すべて正常に動作しています。複数のポリマーWebコンポーネントがFirefoxで失敗する

デモページで一度に1つのコンポーネントを実行すると、Firefox上でレンダリングされます。今では、複数のカスタムコンポーネントを使ったクロスブラウザテストの時点で、Firefox v41を使用しているときは*レンダリングに失敗します。 (1時間ですばやくリフレッシュすると、いくつかのコンポーネントが表示されますが、まったく同じです)

*レンダリングに失敗したということは、ページ上のDOMショーの内容ですが、影に投影されていないようですカスタムコンポーネントで定義されているようにスタイルや関数を継承するのではなく、インデックスファイルからスタイルを継承するだけです。

Firefox用に1つのページに複数のdom-moduleをレンダリングするにはどうすればよいですか?

エラーログ:

Error: DuplicateDefinitionError: a type with name 'dom-module' is already registered 
TypeError: Polymer.Base._getExtendedPrototype is not a function 
TypeError: Polymer.CaseMap is undefined 
TypeError: this._desugarBehaviors is not a function 
TypeError: this._meta.byKey is not a function 
TypeError: Polymer.Base._hostStack is undefined 

インデックスファイル:

<html> 
<head> 
    <link href='/css/styles.css' rel='stylesheet' type='text/css'> 
    <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/ac-theme/color.html"> 
    <link rel="import" href="/bower_components/ac-theme/sizing.html"> 
    <link rel="import" href="/bower_components/ac-messagebar/ac-messagebar.html"> 
    <link rel="import" href="/bower_components/ac-site-footer/ac-site-footer.html"> 
</head> 
<body> 

<ac-messagebar>Message bar.</ac-messagebar> 

    <ac-site-footer small-query="(max-width: 500px)"> 
     <section> 
      <ul> 
       <li> 
        Links<br/> 
        <ul> 
         <li><a href="#">Link 1</a></li> 
         <li><a href="#">Link 2</a></li> 
        </ul> 
       </li> 
      </ul> 
     </section> 
    </ac-site-footer> 
</body> 

カスタムコンポーネント構造:ファイルへのindex.htmlから

<link rel="import" href="../polymer/polymer.html"> 
<link rel="import" href="../ac-theme/color.html"> 
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> 
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> 
<link rel="import" href="../iron-media-query/iron-media-query.html"> 

<dom-module id="ac-site-footer"> 
<template> 
    <style is="custom-style"> 
     :host { 
      /*css;*/ 
     } 
</style> 
    <iron-media-query 
      id="mq" 
      query="{{smallQuery}}" 
      query-matches="{{smallScreen}}" 
      on-query-matches-changed="_screenChanged" 
      ></iron-media-query> 
    <div class="content-container"> 
     <content></content> 
    </div>   
</template> 
<script> 
    Polymer({ 
     is: "ac-site-footer", 
     properties: { 
      smallQuery: { 
       type: String, 
       value: '(max-width: 600px)', 
       notify: true 
      } 
     }, 
     ... 
</script> 

答えて

1
  1. 移動全てlink rel="import"... c allied elements.html(polymer.htmlを含む)。次に、index.htmlファイルにelements.htmlのみをインポートします。

  2. 上記がうまくいかない場合は、components.htmlファイルからpolymer.htmlをインポートして、すべての*/ac-*/*.htmlファイルにpolymer.htmlのインポート文があることを確認してください。

関連する問題