Error: "Cannot read property 'create' of undefined"
Steps to reproduce:
- emulate mobile and go to page that include amp-ad fast fetch network that returns AMP creative which is preferentially rendered (e.g. https://m-wikihow-com.cdn.ampproject.org/v/s/m.wikihow.com/Delete-Messages-on-Facebook-Messenger?amp=1&_js_v=0.1)
- console log will report the following error although there does not appear to be a breakage in terms of creative interaction (can still click and relevant pings fire).
Uncaught TypeError: Cannot read property 'create' of undefined at new tj (v0.js:42) at new Af (document-register-element.node.js:294) at document-register-element.node.js:284 at Wb (document-register-element.node.js:291) at Ql (amp-img.js:152) at Il.f.installExtensionsInChildWindow (vsync-impl.js:438) at friendly-iframe-embed.js:209
Not sure I'm the best person for this issue given its likely a low-level AMP core problem and perhaps related to https://github.com/ampproject/amphtml/issues/15759?
same problem
This is due to re-entrantcy. We're calling installCustomElements(childWin), but it's evaluating in the parent window's JS context, not childWin's. This redefines some data structures, but we've already installed the polyfill in the parent window. When it tries to re-run its tests, it ends up getting caught in this bug.
I'm still seeing this issue constantly in a lot of my articles. could it be affecting ad views?
urls: https://www.inverse.com/amp/article/49479-why-do-elephants-have-wrinkled-cracked-skin https://www.google.com/amp/s/www.inverse.com/amp/article/49479-why-do-elephants-have-wrinkled-cracked-skin

@nikse: It won't affect views. The error in this case is because a polyfill is trying to re-polyfill, so when it fails it continues to be ok.
Interesting, thanks for the quick response. We've actually noticed an ad fill issue since early september and are digging in to everything we can to see what the issue could possibly be, which led me here. Unfortunately it is proving to be extremely difficult to figure out what is happening. I've tried manually looking at the ad responses but can't see anything. Any advice? Thought this issue might be causing some problems, but I guess not
And by ad fill I mean that our ads just aren't rendering/filling even though we have them set to fill at a very low floor and show 100% of the time. I am noticing when this happens that the iframe isn't even rendered in the div, which also led me to investigate this error further
Do you have a reproduction page? I'm not able to look into why ads don't fill, but I can investigate up to the point where AMP decides to inject the iframe. After that, it's up to the bidding process and normal 3p ads code.
Awesome thank you! It really seems to be happening on any of our amp article pages, like this one
direct link: https://www.inverse.com/amp/article/49498-kyrie-irving-flat-earth-apology-education google cache link: https://www.google.com/amp/s/www.inverse.com/amp/article/49498-kyrie-irving-flat-earth-apology-education
Chrome? Safari? iOS?
sorry about that. i am seeing this in chrome, 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)
Ok, so layoutCallback is being called appropriately. But, when it tries to render the iframe, it's apparently already isCollapsed. Can you file a new issue and tag @lannka?
yup! thanks a lot