Missing methods on IE when "Disable Script Debugging" is enabled
On IE (tested on 11 bug same behavior reported on 8 & 9) if the "Disable Script Debugging" setting is enabled IE only provides console.error unless the console is open. This behavior is explains #29.
Attached is the execution of alert(Object.keys(console).join(', ')).
(reactStack and reactStackEnd are side effects of React but is not relevant)

This is the same execution but when the console is open.
Tested on IE 11.15.16299.0 via BrowserStack
You can find an explanation of this behavior in this blog post, https://www.beyondjava.net/console-log-surprises-with-internet-explorer-11-and-edge.
This solution worked for me, https://stackoverflow.com/questions/7742781/why-does-javascript-only-work-after-opening-developer-tools-in-ie-once
I've simplified it to this however,
var console = window.console = window.console || {};
[
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
].forEach(function (method) {
if (!console[method]) {
console[method] = function () {};
}
});
I will submit a PR later today fixing this issue.
I have held back on a PR since I am not sure if @caiogondim wants polyfills essentially bundled in the library.
CoreJS, which are the standard polyfills Babel uses, had console polyfills but they were removed for some reason. So users using this package with CoreJS will encounter this error. I've opened an issue for this https://github.com/zloirock/core-js/issues/633.
Solutions
- Bundle console polyfill, it's small but some clients may not want it
- Split the console polyfill and warn developers that they need to include it if they are not using CoreJS but want to support IE (only if CoreJS will re-introduce console polyfill)