question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] IntersectionObserver not polyfilled on iOS device

See original GitHub issue

What

I am receiving reports of the following error:

Can't find variable: IntersectionObserver

My polyfill request looks like this: https://polyfill.io/v3/polyfill.js?unknown=polyfill&features=default%2CSymbol%2Cfetch%2CArray.prototype.find%2CIntersectionObserver%2CWeakSet%2Ces2015%2Ces2016%2Ces2017&flags=gated

The user agent string: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15

When I call the service with my user agent string spoofed I am receiving the following header in the javascript file:

/* Polyfill service v3.38.0
 * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
 * 
 * Features requested: Array.prototype.find,IntersectionObserver,Symbol,WeakSet,default,es2015,es2016,es2017,fetch
 * 
 * - _ESAbstract.Call, License: CC0 (required by "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015", "_ESAbstract.OrdinaryToPrimitive")
 * - _ESAbstract.CreateMethodProperty, License: CC0 (required by "Math.clz32", "es2015", "Math.sign", "String.prototype.repeat")
 * - _ESAbstract.Get, License: CC0 (required by "_ESAbstract.OrdinaryToPrimitive", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.IsCallable, License: CC0 (required by "_ESAbstract.GetMethod", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015", "_ESAbstract.OrdinaryToPrimitive")
 * - _ESAbstract.RequireObjectCoercible, License: CC0 (required by "String.prototype.repeat", "es2015")
 * - _ESAbstract.ToInteger, License: CC0 (required by "String.prototype.repeat", "es2015")
 * - _ESAbstract.ToObject, License: CC0 (required by "_ESAbstract.GetV", "_ESAbstract.GetMethod", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.GetV, License: CC0 (required by "_ESAbstract.GetMethod", "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.GetMethod, License: CC0 (required by "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.ToUint32, License: CC0 (required by "Math.clz32", "es2015")
 * - _ESAbstract.Type, License: CC0 (required by "_ESAbstract.ToString", "String.prototype.repeat", "es2015", "_ESAbstract.ToPrimitive", "_ESAbstract.OrdinaryToPrimitive")
 * - _ESAbstract.OrdinaryToPrimitive, License: CC0 (required by "_ESAbstract.ToPrimitive", "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.ToPrimitive, License: CC0 (required by "_ESAbstract.ToString", "String.prototype.repeat", "es2015")
 * - _ESAbstract.ToString, License: CC0 (required by "String.prototype.repeat", "es2015")
 * - Math.clz32, License: CC0 (required by "es2015")
 * - Math.sign, License: CC0 (required by "es2015")
 * - String.prototype.repeat, License: CC0 (required by "es2015") */

A search in the rest of the file however shows no sign of IntersectionObserver.

It might be related to: https://github.com/Financial-Times/polyfill-library/issues/285

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24

github_iconTop GitHub Comments

1reaction
EECOLORcommented, Mar 20, 2020

@JakeChampion Thanks for the effort Jake, this was a tricky one!

Read more comments on GitHub >

github_iconTop Results From Across the Web

intersection observer polyfill not working Safari - Stack Overflow
This works fine native in Chromem,Firefox and IE called Intersection Observer. However this is not working in Safari.
Read more >
Safari (iOS) shows blank pages on Discourse instances after ...
The latest build (2.7.0.beta8 f002c58a30) shows a blank webpage on mobile devices with IOS on safari. Can reproduce with Meta instance too.
Read more >
intersection-observer - npm
IntersectionObserver polyfill. This library polyfills the native IntersectionObserver API in unsupporting browsers. See the API documentation ...
Read more >
IntersectionObserver | Can I use... Support tables ... - CanIUse
API that can be used to understand the visibility and position of DOM elements relative to a containing element or to the top-level...
Read more >
T261609 Allow older browsers without IntersectionObserver ...
Is there any way to make wikipedia usable again on older devices? Maybe a way to disable lazy loading altogether, or make wikipedia...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found