ampproject / ampproject/amphtml
Polyfills Throwing Uncaught Exceptions in Safari 11.1
- 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.

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):

### 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
Assessment
This issue has not been assessed yet.