question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AMP hybrid mode is missing required dynamic route query pameters

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
slawekkolodziejcommented, Oct 13, 2020

I created a PR that fixes this: https://github.com/vercel/next.js/pull/17461

1reaction
lfadescommented, Sep 22, 2020

@ayshiff Oh one last thing, this only happens when you run next build 😅

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found