Replies: 1 comment
-
This was converted from an issue to a discussion, which I don't think is accurate - not sure if anyone is able to explain more on why it was classed as not-an-issue? If I'm using the router wrong in some way then it would be handy to know in what way my understanding is wrong, but the fact that is works as I expected it to when you add in a random query param makes this look more like a bug than a misunderstanding... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
Describe the bug
When I have a dynamic url, if you visit the URL directly and without a trailing query string in the url, the query params are empty. If you access the page via a next-link, it works as expected.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
yarn next dev
/helloWorld
router.query
as expectedrouter.query
is emptyrouter.query.foo
is populated correctlycreate-next-app
boilerplate and the implementationExpected behavior
router.query
should be populated with the url paramSystem information
Additional context
My use case is to build static sites; I don't use 'app' output from next at all, only the output from
next export
. I use dynamic urls when I have multiple pages that use the same basic structure but different content. this is why the example commit includes the exportPathMap and getStaticRoutes functions.Beta Was this translation helpful? Give feedback.
All reactions