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

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

Open
ampprojectbot opened this issue Jan 10, 2022 · 8 comments
Open

Comments

@ampprojectbot
Copy link
Member

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:

  • 12-23 Beta (1523+1)

Possible assignees: @jridgewell, @lannka

/cc @ampproject/release-on-duty

@rcebulko
Copy link
Collaborator

@jridgewell You most recently touched this stacktrace on Dec 7 in ampproject/amphtml#37144, would you mind taking a look? Appeared in Beta

@ampprojectbot
Copy link
Member Author

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

@ampprojectbot
Copy link
Member Author

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

@jridgewell
Copy link

jridgewell commented Jan 10, 2022

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

@jridgewell
Copy link

@ampproject/wg-stories

@ampproject ampproject deleted a comment Jan 15, 2022
@ampproject ampproject deleted a comment Jan 15, 2022
@ampproject ampproject deleted a comment Jan 15, 2022
@ampproject ampproject deleted a comment Jan 15, 2022
@ampprojectbot
Copy link
Member Author

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

@ampprojectbot
Copy link
Member Author

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

@mszylkowski
Copy link

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()

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

No branches or pull requests

4 participants