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.

Demo with dynamic routing ?

See original GitHub issue

Hello,

I’m currently having an issue with useQueryState when used in complement of a dynamic routing. I might be missing something but couldn’t find information in the doc :x

I’ve got something like : ‘pages/product/[slug]/[[…params]]’ and I’d like to keep some detail about my product in the URL (variant, size…) but as soon as I set a value I get this error :

Unhandled Runtime Error Error: The provided href (/product/[slug]/[[…params]]?variant=od) value is missing query values (slug, params) to be interpolated properly. Read more: https://nextjs.org/docs/messages/href-interpolation-failed

I use the version 1.6.0 of next-useQueryState.

Any ideas?

Thanks, Bobu

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
franky47commented, Feb 7, 2022

Reopening as I’m now encountering this issue (but not in E2E tests, maybe not all cases are covered).

We could theoretically use window.location.pathname as a replacement for the asPath here, if we assume that the query updater function should only work on the query string (ie: that the pathname remains the same before and after setState).

1reaction
Rambobafetcommented, Feb 3, 2022

Hi! Thanks for the quick reply and patch! Looks good to me, no more errors 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic Routes Demo - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >
Dynamic Routing Demo - Vonage
In this demo, you'll learn how: The CRM can be leveraged for routing decisions; To build a call plan to improve first call...
Read more >
Dynamic Routes Details - Next.js
Sanity Example (Demo). That's it! In the next lesson, we'll talk about API Routes in Next.js. Quick Review: You ...
Read more >
Dynamic Routing in Next.js - Hygraph
Next.js supports dynamic routing, which helps us achieve this use ... For demo purposes, we have populated the data in this file itself....
Read more >
Dynamic Routing Protocols - Catchpoint Systems
Dynamic routing protocols, as their name suggests, are used to dynamically exchange routing information between routers. Their implementation allows network ...
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