-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Null promise in layoutCallback #21116
Comments
Is this still occurring? |
What appears to be happening here is that the I suspect these are rarely or never executed before the If this is indeed the case, I wonder if @keithwrightbos @lannka WDYT? |
@rcebulko Started looking into this error, and realized that it is wrapped in a |
My understanding was that we get rid of |
@calebcordry I can confirm that
|
@calebcordry @powerivq Until recently, this was occurring a bit over 100k times per day. As of the 4/24 release to Beta/Experimental (2004240001480), this error exploded to ~4 million per day, but only on the Experimental channel, and logs suggest predominantly on Android user-agents. See the metrics below: This massive spike on 4/24 is believe to be attributed to this error. Note that it does not appear to impact Beta, suggesting this is related to an experiment being run. Note that if this experiment is enabled in production, It would cause on the order of 800 million errors daily. |
I think there's a race condition where: 1. The element is schedule for layout 2. The page becomes hidden (swipe to next page, or change tabs) 3. The element's scheduled layout finally starts I think the `state` is being reset to `NOT_LAID_OUT` or `READY_FOR_LAYOUT`, and somehow the `startLayout` method is being called. Either state is acceptable for `startLayout` for some reason. Really, we should only be accepting the resource when it's `LAYOUT_SCHEDULED`, which happens when the (async) layout flow is started. If anything happens between the start of that flow and the time the `startLayout` method is called, we're in a broken flow. Re: ampproject#21116
I think there's a race condition where: 1. The element is schedule for layout 2. The page becomes hidden (swipe to next page, or change tabs) 3. The element's scheduled layout finally starts I think the `state` is being reset to `NOT_LAID_OUT` or `READY_FOR_LAYOUT`, and somehow the `startLayout` method is being called. Either state is acceptable for `startLayout` for some reason. Really, we should only be accepting the resource when it's `LAYOUT_SCHEDULED`, which happens when the (async) layout flow is started. If anything happens between the start of that flow and the time the `startLayout` method is called, we're in a broken flow. Re: ampproject#21116
…ayout (#28849) * Prevent layoutCallback if resource state changes after scheduling layout I think there's a race condition where: 1. The element is schedule for layout 2. The page becomes hidden (swipe to next page, or change tabs) 3. The element's scheduled layout finally starts I think the `state` is being reset to `NOT_LAID_OUT` or `READY_FOR_LAYOUT`, and somehow the `startLayout` method is being called. Either state is acceptable for `startLayout` for some reason. Really, we should only be accepting the resource when it's `LAYOUT_SCHEDULED`, which happens when the (async) layout flow is started. If anything happens between the start of that flow and the time the `startLayout` method is called, we're in a broken flow. Re: #21116 * Fix tests * Fix inabox resources
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
i have the issue too on this page after updating wordpress. may i know how to fix this? |
Error: Null promise in layoutCallback
at Error (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/log.js:540)
at apply (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/log.js:244)
at apply (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/log.js:257)
at error (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/extensions/amp-a4a/0.1/amp-a4a.js:987)
at attemptToRenderCreative (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/extensions/amp-a4a/0.1/amp-a4a.js:972)
at implementation_ (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/custom-element.js:598)
at (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/utils/promise.js:75)
at (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/utils/promise.js:74)
at implementation_ (https://raw.githubusercontent.com/ampproject/amphtml/1902191749350/src/custom-element.js:596)
go/amp-error/CJnxr-aJ1pbyEw
go/amp-error/CNmRyfmivLf3Nw
The text was updated successfully, but these errors were encountered: