SSG AMP hybrid mode dynamic route adds "amp":1 to context on build in non AMP article.json
See original GitHub issueBug report
Describe the bug
When using a dynamic route in hybrid mode with getStaticProps and getStaticPaths, all static generated files have added amp: 1
to context.
E.g if getStaticPaths returns /article for [slug].js then these files are generated:
article.amp.html
article.amp.json
article.html
article.json
and in article.json
context is
context: {
params: {
slug : ["article"],
amp: 1
}
}
So first visit on article loads AMP component . Everything goes back to normal once revalidated.
To Reproduce
https://github.com/SuperdeskWebPublisher/publisher-pwa
- download repository.
- build
- go to .next/server/pages/business/WHATEVER.json and look for
context
(value of context.params is added to pageProps)
Expected behavior
Article.json context should not contain amp: 1
System information
- OS: macOS
- Version of Next.js: 9.5.5
- Version of Node.js: 10.15.0
Additional context
this may be connected: #17245
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Make your pages discoverable - amp.dev
Make your pages discoverable. In some cases, you might want to have both a non-AMP and an AMP version of the same page,...
Read more >How to add AMP to Django Project? - GeeksforGeeks
We will add AMP for speed. This article is in continuation of Blog CMS Project in Django. Check this out here – Building...
Read more >Google AMP (1.0.3) - Snowplow Documentation
In order to function, this requires that linkers are enabled in the amp-analytics configuration. Not doing so can result in changing AMP client ......
Read more >What is Google AMP? How does it affect Google Search?
AMP pages load quicker, boost performance and engage the audience. ... AMP websites, AMP stories, AMP ads, and AMP mail serve our needs...
Read more >AMP Integration with Sitecore
Create AMP specific device layout to separate AMP and Non-AMP page and ... href="http://example.ampproject.org/article-metadata.html"> <meta ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe that sooner or later there will be a case when someone will really need to know if
isAmp
at the level of getStaticProps. But yeah so far so good 😃This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.