next.js
next.js copied to clipboard
Incremental Static Regeneration replaces `.amp` with `?amp=1`
trafficstars
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 ispages/[slug]) - In the build phase, the non-amp page
/foorefers to/foo.ampin<link rel="amphtml">correctly. - However when Incremental Static Regeneration is turned on, the
/foo.ampis replaced with/foo?amp=1
To Reproduce
set
- amp: "hybrid"
- add
unstable_revalidate: 30to 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:
after 30sec
System information
- macOS
- Chrome
- Next: 9.4.5-canary.12
- Node: v12.14.1
Additional context
https://github.com/vercel/next.js/issues/13038 https://github.com/vercel/next.js/pull/13046
@Timer can i take this one ?
Sure!
Any update?