Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-bind fails to initialize in PWA #25332

Closed
mattwomple opened this issue Oct 30, 2019 · 6 comments · Fixed by #25337
Closed

amp-bind fails to initialize in PWA #25332

mattwomple opened this issue Oct 30, 2019 · 6 comments · Fixed by #25337

Comments

@mattwomple
Copy link
Member

What's the issue?

amp-bind does not work on the first AMP page loaded into a PWA since release 1910251950120 . It fails to initialize due to a hung promise:

const whenParsed = toArray(ampStates).map(el => {
return whenUpgradedToCustomElement(el)
.then(() => el.getImpl(whenBuilt))
.then(impl => impl.parseAndUpdate());
});

How do we reproduce the issue?

Minimal example AMP and PWA available:

What browsers are affected?

Chrome 78 Windows and Linux tested

Which AMP version is affected?

1910251950120

@mattwomple
Copy link
Member Author

mattwomple commented Oct 30, 2019

/CC @jridgewell I'm just starting to investigate this now, but wanted to ping you in case this has anything to do with custom elements polyfill v1 that was included in 1910251950120. If you could tag relevant people to this issue report it would be much appreciated as it affects a large number of WompMobile PWAs.

@mattwomple
Copy link
Member Author

mattwomple commented Oct 30, 2019

this.whenUpgradedToCustomElement(el) never resolves because nothing ever calls .__AMP_UPG_RES() on the <amp-state> element in the page... which seems to be due to <amp-state> simply not getting upgraded to a custom element.

@jridgewell
Copy link
Contributor

Looking now

@jridgewell
Copy link
Contributor

Found the problem, working on a fix now.

@mattwomple
Copy link
Member Author

I'm a little slower than you, but I think I see. const upgradeCandidates = this.queryAll_(root, query); identifies 0 nodes that can be updated in the upgrade() method in custom-elements.js. Maybe?

@jridgewell
Copy link
Contributor

Yup, I was querying only the document and not the individual shadows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants