ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.89k forks source link

Error: "Cannot read property 'create' of undefined" #19139

Closed github-nourdine-dahmani closed 5 years ago

github-nourdine-dahmani commented 5 years ago

What's the issue?

We should be able to use window.$sf.ext (SafeFrame API) but didn't exist due to this error I think

47360018-8521ec00-d6ce-11e8-92a0-56d3573442c9

When the error "Cannot read property 'create' of undefined" is thrown, the entry point for SafeFrame framework does not exist as it should in the amp-ad type="doubleclick" iframe window (window.$sf).

Seems to be related to the doubleclick component cf https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/safeframe.md

47162753-de67d500-d2f4-11e8-87ce-5356578851aa

Due to the "non-existing" SF entry point, the ad does not understand they are in an AMP SafeFrame context (and can't ask for an opening too)

How do we reproduce the issue?

https://calcio.fanpage.it/amichevole-italia-ucraina-le-ultime-sulle-formazioni-le-quote-e-dove-vederla-in-tv/amp/?google_preview=VR1kgoPGP1MYh5_33QUwh7us5QWIAYCAgKDb8MT0SQ&iu=1010633&gdfp_req=1&lineItemId=4816432979&creativeId=138246844693

What browsers are affected?

Either emulating an iphone or just loading up the non google cache link in desktop mode Google Chrome is up to date Version 69.0.3497.100 (Official Build) (64-bit)

Please find the original thread here: https://github.com/ampproject/amphtml/issues/18507#issuecomment-434502095

aghassemi commented 5 years ago

Seems dup of #18507. @calebcordry assigning to you for triaging.

calebcordry commented 5 years ago

Thanks for pulling this into a separate issue @ndahmani.

@keithwrightbos Can you take a look at what is happening here with SafeFrame? Or please reassign appropriately.

github-nourdine-dahmani commented 5 years ago

Hi Team, thanks for taking a look. @keithwrightbos any chance to have an update? Publishers are asking for an ETA (and are losing monetizations). Feel free to ask if we can provide anything that can help.

keithwrightbos commented 5 years ago

I don't see how the stacktrace above is related to SF usage as the stacktrace is part of FIE rendering for AMPHTML creatives. Note that by default the safeframe API is not included in AMP creatives unless required. Can you try retagging that slot with data-force-safeframe=true which will ensure that the safeframe library is included in the creative (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-ad-network-doubleclick-impl/safeframe.md). Please re-open if you continue to see the issue.

github-nourdine-dahmani commented 5 years ago

Hi @keithwrightbos, Thanks for the feedback much appreciated, Unfortunately, this doesn't solve the issue. Please see below the current setup:

capture d ecran 2018-11-16 a 10 57 43

URL: https://calcio.fanpage.it/amichevole-italia-ucraina-le-ultime-sulle-formazioni-le-quote-e-dove-vederla-in-tv/amp/?google_preview=VR1kgoPGP1MYh5_33QUwh7us5QWIAYCAgKDb8MT0SQ&iu=1010633&gdfp_req=1&lineItemId=4816432979&creativeId=138246844693

github-nourdine-dahmani commented 5 years ago

Hi @keithwrightbos, hope you're good Do you have any news regarding my last comment? Thanks for your help

taacton commented 5 years ago

Hello guys,

I'm having this exact problem on this site too: https://www.freundin.de/beauty-foehn-im-test?amp&google_preview=vQ8hGQ9h31MY1Ifb3wUw1KOQ5wWIAYCAgKDbkYXoCw&iu=40748507&gdfp_req=1&lineItemId=4870567891&creativeId=138251967304

Again, $sf is not defined within the Google safeFrame.

Could someone see if there's any similarities causing the issue?

Thanks!

github-nourdine-dahmani commented 5 years ago

Hi guys, We have more and more complaints from publishers using amp-ad This ticket seems to be not active since it has been closed, ticket reopen here: #19466