AMP hybrid mode is missing required dynamic route query pameters
See original GitHub issueBug report
Describe the bug
When using a dynamic route with getStaticProps
and getStaticPaths
, getStaticProps
executes twice for every defined path but it’s missing the query parameter for the AMP version. This only happens with next build
E.g if getStaticPaths
returns /hello-world
for [slug].js
then getStaticProps
gets executed twice with the following context:
{ params: { slug: 'hello-world' } }
{ params: { amp: '1' } }
Expected behavior
The AMP version should have the required query parameters for the dynamic route.
Additional context
Using Next.js 9.5.4-canary.20
- Happened with both webpack 4 and webpack 5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (8 by maintainers)
Top Results From Across the Web
link to dynamic route with query params not working client-side
I think it's not possible to create a Link for dynamic route with query params in a way which would work both server-side...
Read more >Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. Start creating Dynamic Routes and learn more here.
Read more >NextJS - Appending a query param to a dynamic route
Am I missing something? Is there an easier way to append query params to a dynamic route without doing a server-side re-rendering? Thanks....
Read more >Secure Endpoint Best Practices Guide - Cisco
This document outlines the recommended stages for successfully deploying Cisco Secure Endpoint. The flow chart here serves as a generalized framework for ...
Read more >Input Impedance of an Amplifier and How to Calculate it
Input Impedance, ZIN or Input Resistance as it is often called, is an important parameter in the design of a transistor amplifier and...
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 created a PR that fixes this: https://github.com/vercel/next.js/pull/17461
@ayshiff Oh one last thing, this only happens when you run
next build
😅