ampproject / ampproject/amphtml

Polyfills Throwing Uncaught Exceptions in Safari 11.1

Open
#35,632 5 comments 0 reactions 2 assignees Claimed by @jridgewell View on GitHub
P1: High Priority Stale Type: Bug WG: monetization WG: performance
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

2 Polyfills seem to be the cause of thousands of uncaught exceptions. These end up swamping our logs making it difficult to track other problems.

1. `TypeError: setTimeout is not a function` position-observer.js:116
2. `TypeError: undefined is not an object (evaluating 'Math.round')` intersection-observer.install.js:786

Both are quite shocking but also both point to ampproject source. As a publisher, we do not have control over the ad content and technology. Not sure which ad vendor is the culprit either.

Screenshot below.

![image](https://user-images.githubusercontent.com/55406902/129110620-aed713db-b575-4e1b-8ec2-e44cd2548f1f.png)

links to sources:

https://raw.githubusercontent.com/ampproject/amphtml/2107240354000/ads/inabox/position-observer.js
https://cdn.ampproject.org/rtv/012107240354000/v0/amp-intersection-observer-polyfill-0.1.mjs

New Relic breakdown of errors chiefly related to this by platform (30 minute window):

![image](https://user-images.githubusercontent.com/55406902/129112253-7a7e989c-f753-4332-936d-87e4ffdbee52.png)

### Reproduction Steps

go to https://www.accuradio.com from Safari 11.1
open console
click a channel image to play and launch banner
wait for errors, if no errors yet click genres in left nav to cycle ads (15 second lockout per cycle)

### Relevant Logs

_No response_

### Browser(s) Affected

Safari

### OS(s) Affected

Mac High Sierra but others as well.

### Device(s) Affected

_No response_

### AMP Version Affected

2107240354000

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.