ampproject / ampproject/amphtml

Cannot read property 'ampdoc' of undefined on Amp-next-page

Open
#29,936 3 comments 0 reactions 0 assignees View on GitHub
Component: amp-next-page Customer: Developer P2: Soon Stale Type: Bug Type: UX
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

When developing the amp project page, I use the **amp-next-page** extension version **1.0** (https://github.com/ampproject/amphtml/tree/master/extensions/amp-next-page/1.0). Faced such a problem: if you quickly scroll up/down, then you get duplicate page separators (https://clickio.gyazo.com/f9d2fec4421d5bdf8f1110228d23fa68 ), separators are inserted into the page, but the content of the loaded pages between them (https: //clickio.gyazo. com/ c2150d12ea54633d73ac89802fd52d42 ). In the console of the page, you can see the following errors: https://clickio.gyazo.com/0107e6d4a79b4488848fbb337b020a10. At the same time, no page loading errors are observed in the Network tab: https://clickio.gyazo.com/287aa9f02f5c87d262a0b2021e68cdc7
If you scroll the page at low speed, then such errors still appear in the console (https://clickio.gyazo.com/ddb38830be6d1b6790648f89bf3b4a28 ), but this happens less often, and separators are not duplicated. The general structure of the page looks as it should be: loaded page, separator page, page, page separator, etc.
I did not find any information on how to solve these errors on the Internet, so I am writing here, hoping to get help.
The **amp-next-page** library version **0.1** was previously used on this page and no such problems were observed.

The problem is reproducible in such browsers: **Chrome (v84.0.4147.125)**, **Vivaldi (3.2.1967.47)**
AMP version: **2007302351001**

The page where you can see:
https://amp.clickiocdn.com/a/www.mensagensdebomdia.com.br/bom-dia-colorido?lx_nocache=1&cl_cachebuster=34573465934534&cldaemon=develop
If you need more information, I will provide it upon request.

Contributor guide

Open the contributing guide

Research direction

Start with extensions/amp-next-page/1.0 and reproduce the issue at the provided page URL using rapid and slow scrolling in the listed browsers. Inspect the console error involving ampdoc alongside the page-separator behavior; done means pages load in order without duplicate separators or missing content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.