0

I am new to SP dev fx components and have used react-calendar linked react-calendar. I works fine on Chrome, Firefox but gives error

Object doesn't support property or method 'from'

on Internet Explorer. I have seen that it is because of Polyfill not supported with IE11. I tried to add

import 'core-js/modules/es6.promise'
import 'whatwg-fetch'

import 'core-js/modules/es6.array.iterator.js'
import 'core-js/modules/es6.array.from.js'

import 'es6-map/implement'

but got this error now

in Uncontrolled(Component)in ForwardRefin divin divin divin Unknownin Unknown

I am very new to this and not sure where else to look. Can anyone suggest me what wrong has happened.

Regards, Saghir

2 Answers 2

1

Ran into this exact same issue and symptoms as described above. After walking throught the IE11 stack trace (blech!) and debugging through minified code, I notice that the topmost error was coming from e.createAssignPolyfill method in sp-pages-assembly.js.

This one-liner at the entrypoint of my spfx webpart is what finally worked:

import 'core-js/stable/object/assign'

You would think just drop "polyfill-ie11" or "corejs/stable" would fix everything, but then you run into the "invariant violation: Minified React error". In this case, I needed exactly one polyfill, no more, no less.

Hope this helps!

1
  • Thank you! This worked for me.
    – Robin
    Apr 24, 2020 at 22:56
0

Install polyfill using the command below.

npm install --save @pnp/polyfill-ie11

And then add the below imports to your main .ts file.

import "@pnp/polyfill-ie11";  

If it still not works, try to add the below imports.

import "core-js/es6/array";
import "es6-map/implement";
import "core-js/modules/es6.array.find";
2
  • after importing @pnp/polyfill-ie11 i get Invariant Violation: Minified React error#31 in Unknownin Unknownin Unknownin divin Unknownin formin Unknownin divin asidein Unknownin Unknownin divin Unknownin divin divin Unknownin divin divin Unknownin CustomizedPageLayoutScrollRegionin articlein Unknownin Unknownin Unknownin Unknownin Unknownin Unknownin Unknownin Unknownin Unknownin sectionin divin divin Unknownin Styledundefinedin Unknownin Unknownin Unknownin Unknownin Unknown
    – SAK
    Jan 21, 2020 at 11:36
  • after above error i added the other 3 imports but same error. I removed @pnp/polyfill-ie11 from import keeping the other 3 i go t this in Uncontrolled(Component)in ForwardRefin divin divin divin Unknownin Unknown
    – SAK
    Jan 21, 2020 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.