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.

NextJS doesn't support parsing nested objects in query parameters

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Expected at least nested objects be supported and parsed correctly from query

Current Behavior

It takes the whole thing as a key, instead of creating an nested object Doesn’t matter the format, none of them works /?nested[key]=value or /?nested.key=value

Steps to Reproduce (for bugs)

  1. Open the page with the pattern above
  2. Print the this.props.url.query in top level page component
  3. Does not work

Context

I can’t pass nested object over arbitrarily if I am not using <Link /> component, actually I’m not sure if <Link /> would work with nested object since it is using npm ‘url’ which does not supported nested object parsing…

Btw, I’m currently using https://github.com/ljharb/qs for parsing atm, I hope this saves you all time if you are looking for alternatives.

Your Environment

Tech Version
next 2.4.6
node 8.1.3
OS macOS Sierra
browser chrome
etc

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
arunodacommented, Jul 15, 2017

Yes. This is something we should work on. Will do this after 3.0.

Feel free to send us a PR.

0reactions
arunodacommented, Dec 10, 2017

@chrismatheson as @timneutkens mentioned size of the qs is the problem here. We are open to use a smaller well maintained alternative (if exists)

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - I am trying to pass date object and other nested ...
The searchOptions that I passed has all it's properties filled while pushing. But the query only has destination property filled, and other date ......
Read more >
Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. ... For example, the route /post/abc will have the...
Read more >
NextJS / React SSR: 21 Universal Data Fetching Patterns ...
This is static information that is defined in the query metadata. If the user object is null, meaning that the user is not...
Read more >
Pipes | NestJS - A progressive Node.js framework
Nest interposes a pipe just before a method is invoked, and the pipe receives ... These pipes all work in the context of...
Read more >
Retrieving Data | Firebase Realtime Database - Google
The REST API accepts several query parameters when reading data from our Firebase ... Firebase also supports queries ordered by deeply nested children, ......
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