javascript - Reactjs webapp giving error only in Safari browser - 'undefined' is not a function (evaluating 'ReactElementValidator.createElement.bind(null,type)' -


i have developed react spa , works fine on browsers except safari. error in console attached image below.

error comes 2 files. 1 font-awesome cdn link

and other comes bundle js created using code

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

any links why issue arising? in advance.

error console safari

adding polyfills bind fixed issue.

`if (!function.prototype.bind) {    function.prototype.bind = function(othis) {      if (typeof !== 'function') {          // closest thing possible ecmascript 5         // internal iscallable function    throw new typeerror('function.prototype.bind - trying bound not callable'); }  var aargs   = array.prototype.slice.call(arguments, 1),     ftobind = this,     fnop    = function() {},     fbound  = function() {       return ftobind.apply(this instanceof fnop              ?              : othis,              aargs.concat(array.prototype.slice.call(arguments)));     };  if (this.prototype) {   // function.prototype doesn't have prototype property   fnop.prototype = this.prototype;  } fbound.prototype = new fnop();  return fbound; }; } 

`

after fixing these, got error react intl, works on browsers except safari. there polyfill available 1 in website.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -