ReferenceError: Can't find variable: Set (react.js Only in safari this error is coming) on all other browsers its working perfect but in safari throwing this error showing error in main.js which was build by react when i run this command (npm run build)
You should consider including a global polyfill in your bundled application, such as core-js or babel-polyfill.
Run npm install core-js
or yarn add core-js
and import your specific required features, like so:
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/fn/array/find';
import 'core-js/fn/array/includes';
import 'core-js/fn/number/is-nan';
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
More info: https://reactjs.org/docs/javascript-environment-requirements.html
You can add import "core-js/fn/set";
into your pollyfill.js file, in order to support old browsers.
Note: Please install "core-js" package incase you don't have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With