0

I'm doing SPFx extension with react for SharePoint online and it is working ok in other browsers but not in the IE11. My imports look like this:

import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import "@pnp/polyfill-ie11"; 


import 'es6-promise/auto';
import 'es6-map/implement';
import 'whatwg-fetch';
import "core-js";

import { sp } from "@pnp/sp/presets/all";
.....

I'm fetching list like this: let data = await sp.web.lists.getByTitle(listName).items.get();

Then I catch an error: [object Error]{@@hasInstance: undefined, @@isConcatSpreadable: undefined, @@iterator: undefined, @@match: undefined, @@observable: undefined, @@react.block: undefined, @@react.concurrent_mode: undefined, @@react.context: undefined, @@react.element: undefined, @@react.forward_ref: undefined, @@react.fragment: undefined, @@react.lazy: undefined, @@react.memo: undefined, @@react.portal: undefined, @@react.profiler: undefined, @@react.provider: undefined, @@react.strict_mode: undefined, @@react.suspense: undefined, @@react.suspense_list: undefined, @@replace: undefined, @@search: undefined, @@species: undefined ...}

I tried multiple "combinations" of polyfills that are listed above and on other sites/forums (in case some of them are "overlapping" or something) but now I am stuck and I do not know where to look anymore. Any help/advice would be greatly appreciated.

1
  • 2
    With IE 11 going out of support in M365 on Aug 17th, you may consider attacking it from that approach rather than trying to code around it.
    – Trevor Seward
    Jun 2 '21 at 15:48
0

I've managed to solve the problem. I used deprecated js library sp-pnp-js (https://www.npmjs.com/package/sp-pnp-js). Now it also works in IE11.


I had to change the lines to:

import pnp from "sp-pnp-js";
....

let data = await pnp.sp.web.lists.getByTitle(listName).items.get();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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