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.
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
Post a Comment