We have SPFx webpart on version 1.8.2 using React version 16.7.0. When we test the webpart on Google Chrome it works perfectly fine. But when we test it on Internet Explorer 11 it shows error in browser console of Minified React error #31
. The link in error message redirects here and it mentions error as Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner}).
.
As per the fix suggested here
I fixed this by enforcing a load order in my webpack bundle:
- babel-polyfill
- react
- react-dom
But where I mention this order in my SPFx webpart project? The previous link also suggests adding symbol polyfills, but still no luck and I ran into another error now TypeError: Object doesn't support property or method 'hasOwnProperty'
. Below are the symbol polyfills I imported.
import 'core-js/es6/object';
import 'core-js/es7/object';
import 'core-js/es6/number';
import 'core-js/es6/array';
import 'core-js/es6/symbol';
import 'core-js/es7/symbol';
import "@pnp/polyfill-ie11";
How can I fix this issue?
Update 1:
Initially I thought this issue was fixed because of reordering of polyfills, but the issue still persists. SO I have deleted my answer. A couple of additional updates:
- When I test my webpart in workbench in IE 11, it works. It is only after I deploy the solution and load the page where the webpart is added, is when I get this error.
- I tried the a suggestion mentioned in this article to create source map so that I could debug the minified solution in IE 11, but wasn't able to get it to work.
Can anyone give me pointers as to how can I debug my solution or what can be the problem here?
Updated 2:
I have tried to debug the deployed code via suggestions given here and here. But somehow my tsx
and ts
code runs through and then I get the error.
We are using IE version 11.1565.16299.0
Is there any other way to debug this problem?