-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Passing args in URL with experimental.basePath
causes the page to constantly being reloaded.
#13132
Comments
Hi, it looks like you are setting both |
Hi, I think this is related problem #11992 (comment) here basePath used instead assetPrefix. Problem surface when basePath and assetPrefix used at the same time in the project for generating SSG for example for static site which need basePath for routing prefixes and the same time all static assets should be hosted on another domain or CDN |
Yeah, but in our real case, we are routing this next.js application through |
I'm having the same issue without setting assetPrefix. I'm trying to narrow down the problem. |
Okay this is weird: after cloning @robertovg's repo, I experience those same reloading issues when I I then thought that it must be a server-side rendering issue, but then I tried adding a export async function getServerSideProps(context) {
return {
props: {},
};
} ...and after |
Found which reload we're dealing with:
Continuing to investigate around there... |
So I can't *entirely* explain why, but I believe this fixes #13132. 🙈 I basically ended up looking around at other `_next` URLs (are those asset URLs?) around the project and seeing that they tended to use `delBasePath()` to remove the base path from the current page's path whenever it was used. When testing locally with the [repo submitted with the issue](https://github.com/robertovg/next-base-path-example), I no longer experience the constant page-reloading in dev mode when adding a query string to the URL.
So I can't *entirely* explain why, but I believe this fixes vercel#13132. 🙈 I basically ended up looking around at other `_next` URLs (are those asset URLs?) around the project and seeing that they tended to use `delBasePath()` to remove the base path from the current page's path whenever it was used. When testing locally with the [repo submitted with the issue](https://github.com/robertovg/next-base-path-example), I no longer experience the constant page-reloading in dev mode when adding a query string to the URL.
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. |
Bug report
Describe the bug
We are using next: "^9.4.1" in a project with
experimental.basePath
and when working with the project on development and we have params on URL the page constantly reloads making impossible to work on dev mode.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
I generated a simple repo & code-sandbox to show the problem.
myPath
index
page with a link to add params to the URL,When you load the visit the project with params: Live Sandbox and click on the link, o directly go to the URL with params on the URL
The page loads correctly, but after a second it starts to reload from time to time.
If no params in the URL or
experimental.basePath
set, it works like as expected.Expected behavior
I would like to work with
experimental.basePath
without unexpected page reloads.Additional context
Obviously this is an experimental feature based on this PR but we will need sooner than later in our projects.
Thanks in advance 🙏
The text was updated successfully, but these errors were encountered: