ampproject / error-reporting

Contains production error tracking issues.
Apache License 2.0
2 stars 5 forks source link

🚨 Error: Cannot read properties of null (reading 'setState') #121

Open ampprojectbot opened 2 years ago

ampprojectbot commented 2 years ago

Details

Error report: link First seen: Dec 10, 2021 Frequency: ~ 565/day

Stacktrace

Error: Cannot read properties of null (reading 'setState')
    at setState (amp-story/1.0/amp-story.js:470:23)
    at pause_AMP_PRIVATE_ (amp-story/1.0/amp-story.js:1624:52)
    at onVisibilityChanged_AMP_PRIVATE_ (amp-story/1.0/amp-story.js:737:47)
    at promiseMap_AMP_PRIVATE_ (src/core/data-structures/signals.js:90:26)
    at resolve (src/service/ampdoc-impl.js:759:16)
    at navigationStart (src/service/ampdoc-impl.js:624:55)
    at ancestorOrigins (src/service/viewer-impl.js:607:54)
    at this (src/service/viewer-impl.js:749:32)
    at receiveMessage (amp-viewer-integration/0.1/amp-viewer-integration.js:199:20)
    at handler (amp-viewer-integration/0.1/messaging/messaging.js:416:20)

Notes

@rcebulko modified src/core/data-structures/signals.js:90-90 in #34367 (May 14, 2021) @rsimha modified src/service/ampdoc-impl.js:758-759 in #21212 (May 16, 2019) @jridgewell modified src/service/ampdoc-impl.js:619-633 in #37144 (Dec 7, 2021) @rsimha modified src/service/viewer-impl.js:605-608 in #21212 (May 16, 2019) @lannka modified src/service/viewer-impl.js:749-749 in #6191 (Nov 17, 2016)

Seen in:

Possible assignees: @jridgewell, @lannka

/cc @ampproject/release-on-duty

rcebulko commented 2 years ago

@jridgewell You most recently touched this stacktrace on Dec 7 in https://github.com/ampproject/amphtml/pull/37144, would you mind taking a look? Appeared in Beta

ampprojectbot commented 2 years ago

A duplicate error report was linked to this issue (link)

ampprojectbot commented 2 years ago

A duplicate error report was linked to this issue (link)

jridgewell commented 2 years ago

My change couldn't have caused this. And, it's been in production since at lease May 2021.

jridgewell commented 2 years ago

@ampproject/wg-stories

ampprojectbot commented 2 years ago

A duplicate error report was linked to this issue (link)

ampprojectbot commented 2 years ago

A duplicate error report was linked to this issue (link)

mszylkowski commented 2 years ago

My guess is this error is hapening because getAmpDoc().onVisibilityChanged is triggered before AmpStory.layoutStory on layoutCallback, given that the visibility changes are being listened on the buildCallback() -> initializeListeners()