Hi there,
I'm having an issue using this project with IE11, specifically with this error message in the redux-starter-kit.esm.js file:
Object.keys: argument is not an Object
The issue occurs in the following method on the third line :
```function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source); // <-- error occurs here
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
```
From digging a bit deeper, it seems to try and call Object.keys on a value of false, which then fails in IE11.
The current behaviour in Chrome is to return an empty array when calling Object.keys() on a non-object, but polyfilling IE11's Object.keys() method has so far been unsuccessful.
Should this starter kit work with IE11 out of the box, or is there some guidance on compatibility?
Hmm. I'll be honest and say I've put zero thought into browser compat issues so far.
That particular chunk of code appears to be a Babel polyfill for the object spread operator.
What input and stack trace is leading to that particular edge case getting hit?
@markerikson , I got this same error today. In your code for configureStore, you are calling _objectSpread. That is where the blow up happens when running on IE11.
I tried the react-app-polyfill but it made no difference in this case.
if (devTools) {
finalCompose = composeWithDevTools(_objectSpread({ // <--- here's the call
// Enable capture of stack traces for dispatched Redux actions
trace: !IS_PRODUCTION
}, _typeof(devTools) === 'object' && devTools));
}
Again, to be clear, this is not "our code". That is a Babel build artifact. The actual source is:
If someone can come up with a fix and file a PR, I'm open to taking it, but this is a very low priority concern to me atm.
Closing due to lack of actionable feedback.
In case anyone comes here via google and is looking for a fix, including the es6-shim resolves the issue.
Even simpler fix, just set the devTools option to an empty object in the configureStore
export default configureStore({
reducer: rootReducer,
devTools: {}
});
Most helpful comment
In case anyone comes here via google and is looking for a fix, including the es6-shim resolves the issue.