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.

Route as a modal not working when using getStaticProps

See original GitHub issue

Bug report

Describe the bug

https://github.com/zeit/next.js/tree/canary/examples/with-route-as-modal does not work when using getStaticProps.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Clone the example and add an empty getStaticProps.

Expected behavior

I don’t know if this a bug or expected behavior. Why shouldn’t you able to use shallow routing with dynamic routes?

System information

  • OS: macOS
  • Browser: Chrome
  • Version of Next.js: 9.3.5
  • Version of Node.js: 13.11.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmfurycommented, May 16, 2020

@IAmMorrow & @nimabrownlee – In case it helps to see, here is an approach I’ve used, I have a PR up for a dynamic routes (w/ getStaticProps) variant of this example https://github.com/zeit/next.js/pull/12945

1reaction
IAmMorrowcommented, Apr 19, 2020

I do not know the reason behind this limitation, but it seems that you can’t use this trick if the href is a dynamic route. This is a big drawback. Perhaps this is something that can be easily fixed by the next team.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Route as a modal not working when using getStaticProps
Expected behavior. I don't know if this a bug or expected behavior. Why shouldn't you able to use shallow routing with dynamic routes?...
Read more >
NextJs: Is it possible to load a static page (with dynamic routes ...
Goal: Open statically generated pages inside of a modal on the home page. ... generated articles using getStaticProps/getStaticPaths.
Read more >
Shallow Routing - Next.js
Shallow routing allows you to change the URL without running data fetching methods again, that includes getServerSideProps , getStaticProps , and ...
Read more >
Pre-Rendering and Data Fetching Strategies in Next.js - Telerik
However, the page won't be interactive (like opening a modal) until ... to use both getStaticPaths and getStaticProps , but if it isn't...
Read more >
How to use Prisma in a Next.js app - Daily.dev
See that we are using the Prisma from Node.js; the API routes, ... please report it in https://github.com/prisma/prisma/issues.
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