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 property 'getBoundingClientRect' of undefined #31898

Closed
ampprojectbot opened this issue Jan 12, 2021 · 2 comments
Closed
Labels
Type: Error Report An error reported by AMP Error Reporting

Comments

@ampprojectbot
Copy link
Member

Details

Error report: link
First seen: Nov 19, 2020
Frequency: ~ 945/day

Stacktrace

Error: Cannot read property 'getBoundingClientRect' of undefined
    at getBoundingClientRect (extensions/amp-base-carousel/0.1/dimensions.js:58:16)
    at getDimension (extensions/amp-base-carousel/0.1/dimensions.js:73:23)
    at getCenter (extensions/amp-base-carousel/0.1/dimensions.js:97:6)
    at getPosition (extensions/amp-base-carousel/0.1/dimensions.js:155:16)
    at getPercentageOffsetFromAlignment (extensions/amp-base-carousel/0.1/carousel.js:1241:25)
    at restoreScrollStart_ (extensions/amp-base-carousel/0.1/carousel.js:1218:6)
    at mutator (src/service/mutator-impl.js:227:8)
    at callback (src/service/vsync-impl.js:470:16)
    at callTask_ (src/service/vsync-impl.js:426:8)

Notes

@rsimha modified extensions/amp-base-carousel/0.1/dimensions.js:58-58 in #21212 (May 16, 2019)
Sepand Parhami modified extensions/amp-base-carousel/0.1/dimensions.js:67-86 in #20389 (Jan 17, 2019)
Sepand Parhami modified extensions/amp-base-carousel/0.1/carousel.js:1216-1229 in #20293 (Jan 16, 2019)
@powerivq modified src/service/mutator-impl.js:225-227 in #26638 (Feb 12, 2020)
@jridgewell modified src/service/vsync-impl.js:470-471 in #20836 (Feb 14, 2019)

Seen in:

  • 11-25 Stable (2111+3)
  • 12-23 Control (2217)
  • 12-23 Stable (2217)
  • 12-30 Experiment-A (1722)
  • +6 more

Possible assignees: @powerivq, @jridgewell

/cc @ampproject/release-on-duty

@ampprojectbot ampprojectbot added the Type: Error Report An error reported by AMP Error Reporting label Jan 12, 2021
@micajuine-ho
Copy link
Contributor

Took a quick peak at the error links--all of the carousels on those pages seem to have the same structure:

<p>
  <amp-carousel>
    <div class="ampforwp-gallery-item amp-carousel-container"><amp-img></amp-img></div>
    <div class="ampforwp-gallery-item amp-carousel-container"><amp-img></amp-img></div>
    <div class="ampforwp-gallery-item amp-carousel-container"><amp-img></amp-img></div>
  </amp-carousel>
</p>

<p> tags are only allowed to have "paragraph content" within them (all other tags, including divs, will get stripped by the browser). This causes all the carousels to have no slides--which probably causes the error found above.

This is essentially the same problem as #31251.

Maybe this sort of developer error can be fixed with wider documentation for 'common issues'?

/cc @ampproject/wg-components

@micajuine-ho
Copy link
Contributor

Closed via #31945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Error Report An error reported by AMP Error Reporting
Projects
None yet
Development

No branches or pull requests

2 participants