Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken in IE11 due to calling console.warn.apply with null #773

Closed
skatcat31 opened this issue Mar 7, 2019 · 0 comments
Closed

Broken in IE11 due to calling console.warn.apply with null #773

skatcat31 opened this issue Mar 7, 2019 · 0 comments

Comments

@skatcat31
Copy link
Contributor

skatcat31 commented Mar 7, 2019

Describe the bug
When transpiling to IE11, a console.warn statement is being called with the specific footprint of console.warn.apply(null, args) in the function warn

  function warn() {
    if (console && console.warn) {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
      console.warn.apply(null, args);
    }
  }

Occurs in react-i18next version
from our package.json: "react-i18next": "^10.2.0"

To Reproduce
Steps to reproduce the behavior:

  1. attempt to cause a warning in IE11

Expected behaviour
The script continues to execute

Actual Behavior
The script on IE11 fails due to incorrectly calling console.warn with a null context

Screenshots
screen shot 2019-03-07 at 11 48 20 am

OS (please complete the following information):

  • Device: Windows 7
  • Browser: IE11

Additional context
This cannot be recreated when dev tools are open due to the way dev tools wraps the console methods when injecting itself.

We have not checked for other console statement in the package

Any console statements called with apply with a context of null will fail.

This should be a simple fix of just replacing null in these apply statements with console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant