The basePath is repeated twice in URL with query params
See original GitHub issueBug report
Describe the bug
The basePath is repeated twice in URL when we add query parameters. Say we have set basePath: '/base'
in next.config.js
, if we enter the /base?foo=bar
, it changes to the /base/base?foo=bar
.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Run the https://repl.it/@theshem/NextBasePathWithQueryParams
- Navigate to https://nextbasepathwithqueryparams.theshem.repl.co/base?foo=bar
Expected behavior
The URL should remain unchanged. I.e. /base?foo=bar
.
Screenshots
System information
- OS: macOS 10.14.5
- Browser (if applies) Chrome 85
- Version of Next.js: 9.5.3
- Version of Node.js: 12.x
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Correct way to pass multiple values for same parameter name ...
Most applications use the first option you have shown: http://server/action?id=a&id=b .
Read more >Query string contains repetitive parameters - Sitebulb
Query string contains repetitive parameters. This means that the URL in question contains a query string with the same parameter more than once....
Read more >Spring WebClient Requests with Parameters - Baeldung
Learn how to reactively consume REST API endpoints with WebClient from Spring Webflux.
Read more >ASP.NET Core Blazor routing and navigation - Microsoft Learn
Learn how to manage request routing in Blazor apps and how to use the Navigation Manager and NavLink component for navigation.
Read more >Paths and Operations - Swagger
All paths are relative to basePath (see API Host and Base URL). ... Swagger supports operation parameters passed via path, query string, headers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Well, since the PR with a fix didn’t get any attention so far, I have implemented an ugly workaround. Just call this hook in you
index
page and it should get the work done; I lose hash part of URL if also query string is present, but other than that it seems to get the job done:(Edit: Removed interpolation, replicates stored history state)
Has this been fixed? I’m not seeing it in the latest versions.