2016-07-28 1 views
0

Safari以外のすべてのブラウザで反応するSPAを開発しました。私は私のコンソールで取得エラーは、以下の画像のように装着されている。Safariブラウザでのみエラーが発生するReactjs webapp - '未定義'は関数ではありません(ReactElementValidator.createElement.bind(null、type)を評価中)

エラー2つのファイルから来ています。一つは、フォント素晴らしいCDNリンク

からであり、他のコードを使用して作成された私のバンドルのjsから来ています

gulp.task("bundle", function() { 
return browserify({ 
    entries: "./app/js/index.jsx", 
    debug: true 
}).transform(reactify) 
    .bundle() 
    .pipe(source("bundle.js")) 
    .pipe(gulp.dest("app/")) 

}) 

この問題の原因となるリンク起こっている?前もって感謝します。バインドのための

Error console for Safari

答えて

0

追加polyfillsは、問題を修正しました。

`if (!Function.prototype.bind) { 
    Function.prototype.bind = function(oThis) { 
    if (typeof this !== 'function') { 
     // closest thing possible to the ECMAScript 5 
     // internal IsCallable function 
    throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); 
} 

var aArgs = Array.prototype.slice.call(arguments, 1), 
    fToBind = this, 
    fNOP = function() {}, 
    fBound = function() { 
     return fToBind.apply(this instanceof fNOP 
      ? this 
      : oThis, 
      aArgs.concat(Array.prototype.slice.call(arguments))); 
    }; 

if (this.prototype) { 
    // Function.prototype doesn't have a prototype property 
    fNOP.prototype = this.prototype; 
} 
fBound.prototype = new fNOP(); 

return fBound; 
}; 
} 

`

これらを固定した後、私は別のエラーを得たのサファリを除くすべてのブラウザで動作しますINTLを、REACT。したがって、Webサイトにもそのポリ充てんがあります。

関連する問題