in

Dot Net Mafia

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for Ionic, SharePoint, and Office 365.

Use the new IE11 Polyfill package with PnPJS 1.2.4

Recently, I posted about the error (TypeError: Object doesn't support property or method 'from') you received in Internet Explorer 11 (IE11) when you didn't include the necessary polyfills for PnP JS to work.  To resolve the error, previously you had to include the following Polyfills to provide support for things like proxy, fetch, and map.

import "core-js/modules/es6.promise"

import "core-js/modules/es6.array.iterator.js"

import "core-js/modules/es6.array.from.js"

import "whatwg-fetch"

import "es6-map/implement"

Now with PnPJS 1.2.4, this has been simplified a bit with a new single package.  First, install the package @pnp/polyfill-ie11.

npm install --save @pnp/polyfill-ie11

Now remove all of the previous imports from your web part class and replace it with the following single import.

import "@pnp/polyfill-ie11";

Now, give your code a try inside Internet Explorer.  All of your PnPJS calls should work normally.  What's nice about this version of the Polyfill si that we have support for SearchQueryBuilder which I believe wasn't there before.

You can read more about the new Polyfill package on the PnPJS site.

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2018 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems