2017-11-15 8 views
0

私はターボリンク付きのRailsアプリを持っています。キャッチされていないタイプのエラー:プロパティを再定義できません:nativeReduce

:coffeescript 
    ready = -> 
    fc_CSS = document.createElement('link') 
    fc_CSS.setAttribute 'rel', 'stylesheet' 
    fc_isSecured = window.location and window.location.protocol == 'https:' 
    fc_lang = document.getElementsByTagName('html')[0].getAttribute('lang') 
    fc_rtlLanguages = [ 
     'ar' 
     'he' 
    ] 
    fc_rtlSuffix = if fc_rtlLanguages.indexOf(fc_lang) >= 0 then '-rtl' else '' 
    fc_CSS.setAttribute 'type', 'text/css' 

    // freshdesk widget generated code 


    $(document).ready(ready) 
    $(document).on('turbolinks:load', ready) 

レディ機能が毎回実行されますが、そのエラーが発生している:私は、私はheadタグ内のページ

Uncaught TypeError: Cannot redefine property: nativeReduce at Function.defineProperty() at visitor.js:1 (anonymous) @visitor.js:1

を更新したときに、私はこのコードを持って、このエラーを取得します。ターボリンクを取り外すと機能しますが、ターボリンクを維持したいと思います。

私が望むのは、ページを更新せずにfreshdeskウィジェットを表示させることです。

答えて

0

FreshDeskのウィジェットの仕組みは絶対にわかりませんが、レンダリングする前にウィジェットを破棄して再初期化する必要があります(Google Analyticsなど)。

ここにいくつかの良いリード:http://reed.github.io/turbolinks-compatibility/

関連する問題