Skip to content

Incremental Static Regeneration replaces .amp with ?amp=1 #14251

@wawoon

Description

@wawoon

Bug report

Describe the bug

  • When the page is built with Amp and SSG config, the output url of amp page becomes /foo.amp (routing is pages/[slug])
  • In the build phase, the non-amp page /foo refers to /foo.amp in <link rel="amphtml"> correctly.
  • However when Incremental Static Regeneration is turned on, the /foo.amp is replaced with /foo?amp=1

To Reproduce

set

  • amp: "hybrid"
  • add unstable_revalidate: 30 to getStaticProps return value.

reproduce:
https://github.com/wawoon/next-amp-ssg-reproduce

yarn build
yarn start
go to http://localhost:3000/foo

Expected behavior

The non amp page should always refer to/foo.amp in <link rel="amphtml"> tag even if Incremental Static Regeneration is turned on.

Screenshots

initial access:

スクリーンショット 2020-06-17 12 59 06

after 30sec

スクリーンショット 2020-06-17 12 59 35

System information

  • macOS
  • Chrome
  • Next: 9.4.5-canary.12
  • Node: v12.14.1

Additional context

#13038
#13046

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pages RouterRelated to Pages Router.good first issueEasy to fix issues, good for newcomers

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions