Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic route and additional search params in url in NextJS #26602

Closed
sunpietro opened this issue Jun 25, 2021 · 3 comments
Closed

Dynamic route and additional search params in url in NextJS #26602

sunpietro opened this issue Jun 25, 2021 · 3 comments
Labels
please add a complete reproduction Please add a complete reproduction.

Comments

@sunpietro
Copy link

What version of Next.js are you using?

10.1.3

What version of Node.js are you using?

14.17.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

other platform

Describe the Bug

I have defined a dynamic route [lang]/something/[[...dynamicParams]]/index.tsx and when I'm trying to redirect a user after submitting a form to an url like [:lang]/something/[...dynamicRouteParams]?searchParam=true (this is a representation of url, not an actual url). The important part here is an additional query param.

router.push('en/something/dynamicParam1/dynamicParam2?searchParam=true'); 

Unfortunately, after page reload an url in the browser address bar is showing: en/something/dynamicParam1/dynamicParam2?searchParam=true&lang=en&dynamicRouteParams=dynamicParam1&dynamicRouteParams=dynamicParam2.

Similar behaviour happens when using the next/link component.

Expected Behavior

I'm expecting an url as en/something/dynamicParam1/dynamicParam2?searchParam=true after page reload.

To Reproduce

router.push('en/something/dynamicParam1/dynamicParam2?searchParam=true'); 
@sunpietro sunpietro added the bug Issue was opened via the bug report template. label Jun 25, 2021
@timneutkens timneutkens added please add a complete reproduction Please add a complete reproduction. and removed bug Issue was opened via the bug report template. labels Jun 25, 2021
@timneutkens
Copy link
Member

Please add a complete reproduction

@ijjk
Copy link
Member

ijjk commented Sep 19, 2021

Hi, this appears to be working correctly in the latest version of Next.js v11.1.2, please update and give it a try!

@ijjk ijjk closed this as completed Sep 19, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
please add a complete reproduction Please add a complete reproduction.
Projects
None yet
Development

No branches or pull requests

4 participants