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.

Query in url problem

See original GitHub issue

On my old site I used a bit wired queries in the links, so I need to make my links looks like:

http://site.localhost/post/amazing-slug/?i=b3-cc6d-3e-718c2

I have route setup for /post/amazing-slug/

Visiting full url on dev-server it loads spinner and gives following error:

getRouteProps could not find any props for route: /post/amazing-slug/?i=b3-cc6d-3e-718c2. Either you are missing a getProps function for this route in your static.config.js or you are using the getRouteProps HOC when you don't need to.

When visiting the same url on exported(build) pages(served via nginx) it’s just white screen but I can see that network request sent back correct response for the route /post/amazing-slug/

Is this a bug or correct behavior? Because if route can’t be handled shouldn’t we serve 404 instead of blanks 😃 ? cheers.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
lottamuscommented, Jan 5, 2018

@EmilTholin should query strings be considered as part of the route path? Or perhaps a fallback if pathname + search isn’t found to look for just pathname?

2reactions
tannerlinsleycommented, Jan 31, 2018

I’ve removed all search params from the path matching algo, so you should be free to use them to your advantage. My recommendation for the pagination scenario is to simply not rely on search parameters for static export, and instead use the path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix a URL Question Mark Issue - Sitechecker
One of the most common problems when using question marks is that query components find it difficult to identify the URL's primary function, ......
Read more >
A Beginner's Guide to URL Parameters - SEMrush
In this comprehensive guide, we explore the ins and outs of URL parameters. Discover now how to use query strings without hurting your ......
Read more >
Why is URL query string value causing "Can't reach this page ...
The problematic part of the URL is the ReportTitle query string value. When I click the link in Internet Explorer 11 or Microsoft...
Read more >
Query string - Wikipedia
A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes...
Read more >
Query string contains a question mark | Sitebulb
In a URL, the query starts with a question mark - the question mark is used as a separator, and is not part...
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