Amphtml: New bug from 3/31 Uncaught TypeError: Cannot read property 'length' of undefined

Created on 31 May 2018  路  9Comments  路  Source: ampproject/amphtml

Working on Jekyll and suddenly today functionality is dead and new errors. Confirming this is a bug with your last update because our current code base was run locally and on firebase, and we haven't deployed to firebase since May 23, but both the local and test environment on firebase both have the exact same issues. https://website-1b14f.firebaseapp.com/

Uncaught TypeError: Cannot read property 'length' of undefined
    at Ga (string.js:79)
    at nk.f.handleAmpTarget (resources-impl.js:1513)
    at Kg (v0.js:158)
    at l (v0.js:157)
    at v0.js:157
    at Array.forEach (<anonymous>)
    at Jg (v0.js:157)
    at Fg.f.trigger (event-helper.js:66)
    at HTMLDocument.<anonymous> (priority-queue.js:99)
Ga @ string.js:79
f.handleAmpTarget @ resources-impl.js:1513
Kg @ v0.js:158
l @ v0.js:157
(anonymous) @ v0.js:157
Jg @ v0.js:157
f.trigger @ event-helper.js:66
(anonymous) @ priority-queue.js:99
13:01:11.412 string.js:79 Uncaught TypeError: Cannot read property 'length' of undefined
    at Ga (string.js:79)
    at nk.f.handleAmpTarget (resources-impl.js:1513)
    at Kg (v0.js:158)
    at l (v0.js:157)
    at v0.js:157
    at Array.forEach (<anonymous>)
    at Jg (v0.js:157)
    at Fg.f.trigger (event-helper.js:66)
    at HTMLDocument.<anonymous> (priority-queue.js:99)
Ga @ string.js:79
f.handleAmpTarget @ resources-impl.js:1513
Kg @ v0.js:158
l @ v0.js:157
(anonymous) @ v0.js:157
Jg @ v0.js:157
f.trigger @ event-helper.js:66
(anonymous) @ priority-queue.js:99
13:01:11.670 string.js:79 Uncaught TypeError: Cannot read property 'length' of undefined
    at Ga (string.js:79)
    at nk.f.handleAmpTarget (resources-impl.js:1513)
    at Kg (v0.js:158)
    at l (v0.js:157)
    at v0.js:157
    at Array.forEach (<anonymous>)
    at Jg (v0.js:157)
    at Fg.f.trigger (event-helper.js:66)
    at HTMLDocument.<anonymous> (priority-queue.js:99)
High Priority Bug runtime

All 9 comments

All button elements, except for the amp-sidebar, are dead.

Uncaught TypeError: Cannot read property 'length' of undefined
    at Ga (string.js:79)
    at nk.f.handleAmpTarget (resources-impl.js:1513)
    at Kg (v0.js:158)
    at l (v0.js:157)
    at v0.js:157
    at Array.forEach (<anonymous>)
    at Jg (v0.js:157)
    at Fg.f.trigger (event-helper.js:66)
    at HTMLDocument.<anonymous> (priority-queue.js:99)

Simple repro, paste this into amp by example. It will throw when clicked. <div role="button" on="tap:AMP.navigateTo(url='https://www.google.com')">foo</div>

Sorry for the breakage -- the offending release was rolled back and we're in the middle of patching and rolling forward. Dupe of #15684 and fixed by #15693.

Appreciate the time lookinginto this. As early adopters and investors in AMP, I鈥檇 kindly ask for clarification on how this happened and if we can trust the AMP team is working to implement safeguards. Not to beat a dead horse, but an issue like this could put our site down for an entire day, potentially costing us thousand of dollars. Is there anything I can do to acoid this, like host a local copy of AMP js files?

You could host a local copy but we don't recommend it since you won't receive high priority bug fixes and your pages won't pass AMP validation. I'd recommend testing our "canaries" which are released one week prior to production pushes -- opt into these on https://cdn.ampproject.org/experiments.html (sets a cookie on the CDN domain).

Sorry again for the breakage. We try our best to ship a stable product and we have several initiatives to increase release stability including visual diffing and regression testing. Unfortunately sometimes bugs like this one fall through the cracks and our unit test suite wasn't able to catch it. #15714 adds integration tests for this and other features and I've verified that it would've caught this bug and will prevent future regressions.

Thanks for reporting this issue and giving feedback. As an OSS project, we're open to suggestions on how we can improve product quality and ask for your patience as we improve things!

Thank you choumx. Problem solved. We鈥檒l look at the canaries. It鈥檚 a bit frustrating because the AMP team doesn鈥檛 seem very accessible. Could just be the time diffeence. Now just waiting for better integration with Firebase, as those scripts are blocked. I鈥檒l open a new feature request to see if you can whitelist firebase scrpits. Thanks again for responding. Cheers!

We're pretty active on GitHub, but most of us are located on PST and EST time zones so response latency could vary depending on your locale. Thanks for understanding!

Was this page helpful?
0 / 5 - 0 ratings