amp-next-page issue when document is served from Google AMP viewer
Creating this master issue to track the various issues affected by amp-next-page and Google AMP viewer. Specifically, this affects amp-img and amp-ad components on the next page.
Related issues so far are #30641, #31775, #31841.
@dmanek do you think that #29449 can also be related?
@dmanek We started seeing a new issue today -- I've been able to reproduce on two iPhones and Chrome Emulator. Also confirmed a co-worker is able to reproduce.
Issue: When I approach the end of the first article and the start of the amp-next-page article, the user is sent back to the top of the first article.
To reproduce:
- Search "CNET" in Google, click on an AMP page from SERP
- Scroll to near end of article and into amp-next-page.
- Notice that you are thrown back to top of the first article
Demo:
- Via iPhone Safari browser: https://drive.google.com/file/d/1WrT03HMOhQ0Oaw2BMbjbtVWyiiKByRxT/view?usp=sharing
- Via Chrome Emulator: https://drive.google.com/file/d/1xqu3BaJRXhGr3fT-zuFVT2VrdvZiXCsV/view?usp=sharing
thanks for looking into all this! 🎉
in addition, there's also this long standing issue of the browser url not updating correctly, and only when on the google cdn. Not sure if there was ever a github issue specifically for this.
(update: this is on the now unsupported v0.1 of amp-next-page)
valid url prefix: https://www.google.com/amp/s/amp.gossipcop.com/ https://www.google.com/amp/s/amp.gossipcop.com/chuck-norris-rep-responds-to-twitter-suspicions-the-walker-texas-ranger-star-was-at-capitol-siege/2560512
^ it starts at a valid url, but below are the broken urls amp-next-page updates the browser to
scroll into an infinite article: invalid url prefix: https://www.google.com/amp/s/amp.gossipcop.com/c/s/amp.gossipcop.com/ https://www.google.com/amp/s/amp.gossipcop.com/c/s/amp.gossipcop.com/paris-hilton-engaged-to-boyfriend-carter-reum/2560562#ampf=
scroll back up to original article: invalid url prefix: https://www.google.com/amp/s/amp.gossipcop.com/v/s/amp.gossipcop.com/ https://www.google.com/amp/s/amp.gossipcop.com/v/s/amp.gossipcop.com/chuck-norris-rep-responds-to-twitter-suspicions-the-walker-texas-ranger-star-was-at-capitol-siege/2560512%3famp_js_v=0.1&usqp=mq331AQFKAGwASA%253D#ampf=
@oliverfernandez that issue may be related. I'll investigate and update if necessary.
@Cauchon thanks for reporting this. I cannot repro this. If you can repro again, can you provide more details, like console errors, etc?
@andyblackwell could #28673 be related? If not, can you please file a new issue?
no it's different, but we're actually on the now unsupported v0.1 still, so a new issue would likely be ignored/closed. we haven't updated to v1.0 due to the large change around hiding amp-next-page content. if you'd still like me to make an issue for that though, let me know.
@Cauchon thanks for reporting this. I cannot repro this. If you can repro again, can you provide more details, like console errors, etc?
@dmanek Right when the issue happens, I get the [multidoc-manager] error in console. Then after it scrolls back to the top of the doc, the other Uncaught TypeErrors show up. See below.

Also confirming that I've only been able to reproduce via the AMP cache on pages with amp-next-page.
Let me know if you need any more debugging details -- I'm monitoring this ticket and also available in the AMP Slack.
EDIT: Also adding a video example using @andyblackwell's AMP site: https://drive.google.com/file/d/183EeZTTZhehPya9f9oTVZeDlKXWskinY/view?usp=sharing
@andyblackwell yes, we're only supporting v1.0.
@Cauchon I fixed the multidoc-manager console error yesterday as part of #31966. Though I doubt that is what's causing the issue. I'll try to repro and will update with more details.
@andyblackwell yes, we're only supporting v1.0.
@Cauchon I fixed the
multidoc-managerconsole error yesterday as part of #31966. Though I doubt that is what's causing the issue. I'll try to repro and will update with more details.
Hi, any update?
@dmanek Have you been able to reproduce the scrolling issue? Using non-scientic polling of our staff here, it seems mostly reproducible on iPhone, not as reproducible on Android.
Noting that the other issue (amp-ad placeholder/amp-img missing) does seem to be fixed right now.
@Cauchon Yes, I was finally able to repro the issue! I created a new issue (above) for it, so we can track it separately. Thanks for reporting this & glad that the amp-ad/amp-img issue is fixed.
Closing as the amp-next-page issue in Google AMP viewer (affecting amp-img and amp-ad components) is fixed.