Amphtml: Cannot read property 'frameElement' of null

Created on 21 Jun 2019  路  17Comments  路  Source: ampproject/amphtml

What's the issue?

An unhandled exception is raised:

TypeError: Cannot read property 'frameElement' of null

How do we reproduce the issue?

Check details here: https://sentry.io/share/issue/7cfc752c7b4b41109082328ee016644c/

What browsers are affected?

Chrome

Which AMP version is affected?

https://raw.githubusercontent.com/ampproject/amphtml/1906111828200/ads/inabox/position-observer.js

AMPHTML ads Soon Bug monetization

Most helpful comment

Same issue, it's eating up my Sentry quota. Any tip to get around this?

All 17 comments

cc @ampproject/wg-ads 馃槃

I also see this issue. We use Google AdSense and this is breaking some of our pages

is there any ETA for when this would be fixed?

/to @lannka

I can try and add as much info as possible.
Its an angular 8 application and we have it fire from multiple places
https://sentry.io/share/issue/4478b945b1144f53ab86dac016c61f61/
https://sentry.io/share/issue/0e6de6350f8d4ca6925d8ba88bd6913d/
https://sentry.io/share/issue/f74f8f8c00da4d0cba9c95e6caee6a53/
https://sentry.io/share/issue/2c631029a48045199889b98ee289c864/
https://sentry.io/share/issue/2c631029a48045199889b98ee289c864/

in our index.html we import

and here is where we attempt to initialize ads

<ins *ngIf="!ad.responsive" class="adsbygoogle"
    style="display:block; margin:auto;"
    [style.width]="ad.width"
    [style.height]="ad.height"
    data-ad-client="ca-pub-8778045886587478"
    [attr.data-ad-slot]="ad.id"></ins>

<ins *ngIf="ad.responsive" class="adsbygoogle"
    style="display:block; margin:auto;"
    data-ad-client="ca-pub-8778045886587478"
    [attr.data-ad-slot]="ad.id"
    data-ad-format="auto"
    data-full-width-responsive="true"></ins>

then inside our js we do
try {
const adsbygoogle = (window as any).adsbygoogle;
adsbygoogle.push({});
return true;
} catch (e) {
return e;
}

I guess a question I have now is. We arent using amp ads or at least from my understanding we are using regular ads and not auto ads for amp, so should we even see amp references?

so besides the original issue posted above we also saw additional issues around the same area. Let me know if there is any other info that would be useful.

Same issue, it's eating up my Sentry quota. Any tip to get around this?

Do you have a page that causes this error?

@jridgewell to give as much context as possible. There was an issue raised by our users saying our page would lock and would not be able to scroll up and down. Primarily on mobile but a few times on desktop. One time when a user had the issue reported we were able to get them to open dev console and send a screenshot and that's how we traced to the ads causing the problem. We have since then removed all ads and have no more reported issues.
image
This is what we were given by our users.

But to answer your question. We do not currently have any pages that could result in this problem. Thats been a bit of an issue, we couldnt find any real commonality between when users reported this problem.

are there any updates on the status of this?

Not sure but this propably has to do with overriding on IntersectionObserver.observe(). I override the observe() like bellow and see the error:

const observeIntersection = IntersectionObserver.prototype.observe;
IntersectionObserver.prototype.observe = function (target) {
    //...
    return observeIntersection.call(this, target);
}

To fix, I replaced call with apply: observeIntersection.apply(this, arguments).

Are there any updates on this?

Not AMP, but I'm using the React AdSense component and have the same issue. Error message below:

Screen Shot 2019-11-18 at 8 13 07 pm

Ping @lannka

Not AMP, but I'm using the React AdSense component and have the same issue. Error message below:

Screen Shot 2019-11-18 at 8 13 07 pm

Having the exact same issue, my sentry logs are spammed by this and I'm reaching my monthly limit because of that. I hope this gets fixed soon or a solution on how to bypass it

@danyalasif You can always temporarily ignore the error until the issue is resolved
https://stackoverflow.com/questions/55846690/how-to-globally-ignore-errors-with-sentry-v5-to-reduce-noise

I use rollbar and I have done a similar thing for now

The issue for us is this seemed to be linked to breaking our page and particularly causing our page to not be scrollable.

Fix is coming.

Was this page helpful?
0 / 5 - 0 ratings