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

IE9: Unable to call apply on console.error when encountering an unknown tag #13610

Closed
nhunzaker opened this issue Sep 10, 2018 · 4 comments
Closed

Comments

@nhunzaker
Copy link
Contributor

This was introduced in React 16.5.0.

If IE9 encounters an unknown html element in development, React crashes as it attempts to call console.error.apply here:

console.error('Warning: ' + format, ...stringArgs);

This is reproduceable with the following CodePen:

Code
https://codepen.io/nhunzaker/pen/YOeZXv

Demo
https://s.codepen.io/nhunzaker/debug/YOeZXv/mWMoNxzPjbZk

@gaearon
Copy link
Collaborator

gaearon commented Sep 10, 2018

What's the error?

@nhunzaker
Copy link
Contributor Author

The spread operator turns into apply like so:

// Before: console.error('Warning: ' + format, ...stringArgs);
console.error.apply(console, ['Warning' + format].concat(stringArgs))

IE9 doesn't support apply on console.error:

screen shot 2018-09-10 at 1 50 50 pm

@link-alex
Copy link
Contributor

I can try to check this one as "good first issue" if you don't mind :)

link-alex added a commit to link-alex/react that referenced this issue Sep 11, 2018
Where console methods like log, error etc. don't have 'apply' method.
Because of the lot of tests already expect that exactly console['method']
will be called - had to reapply references for console.error method

facebook#13610
link-alex added a commit to link-alex/react that referenced this issue Sep 12, 2018
Where console methods like log, error etc. don't have 'apply' method.
Because of the lot of tests already expect that exactly console['method']
will be called - had to reapply references for console.error method

facebook#13610
gaearon pushed a commit that referenced this issue Sep 12, 2018
* Fix warning without stack for ie9

Where console methods like log, error etc. don't have 'apply' method.
Because of the lot of tests already expect that exactly console['method']
will be called - had to reapply references for console.error method

#13610

* pass parameters explicitly to avoid using .apply
which is not supported for console methods in ie9

* Minor tweaks
@gaearon
Copy link
Collaborator

gaearon commented Sep 13, 2018

Should be fixed in 16.5.1

@gaearon gaearon closed this as completed Sep 13, 2018
Simek pushed a commit to Simek/react that referenced this issue Oct 25, 2018
* Fix warning without stack for ie9

Where console methods like log, error etc. don't have 'apply' method.
Because of the lot of tests already expect that exactly console['method']
will be called - had to reapply references for console.error method

facebook#13610

* pass parameters explicitly to avoid using .apply
which is not supported for console methods in ie9

* Minor tweaks
jetoneza pushed a commit to jetoneza/react that referenced this issue Jan 23, 2019
* Fix warning without stack for ie9

Where console methods like log, error etc. don't have 'apply' method.
Because of the lot of tests already expect that exactly console['method']
will be called - had to reapply references for console.error method

facebook#13610

* pass parameters explicitly to avoid using .apply
which is not supported for console methods in ie9

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

No branches or pull requests

3 participants