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.

Passing args in URL with `experimental.basePath` causes the page to constantly being reloaded.

See original GitHub issue

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.

  • Contains a basepath set to myPath
  • Only contains a simple 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 🙏

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
designbyadriancommented, May 20, 2020

I’m having the same issue without setting assetPrefix. I’m trying to narrow down the problem.

1reaction
robertovgcommented, May 20, 2020

Hi, it looks like you are setting both assetPrefix and basePath to the same path here. You only need to set basePath in this case since /_next requests will automatically be prefixed with the basePath

Yeah, but in our real case, we are routing this next.js application through Traefik through the same base_path, and we need both the app and the assets to be served inside the same base_path. That’s why we need to change both.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getServerSideProps data urls don't respect assetPrefix #11992
DrUNE mentioned this issue on May 20, 2020. Passing args in URL with experimental.basePath causes the page to constantly being reloaded.
Read more >
javascript - Set URL parameters without causing page refresh
Just to be clear, I am referring to the URL parameters in a query string: http://google.com/page?name=don so we could change don to tim...
Read more >
visit - Cypress Documentation
Configure baseUrl in the Cypress configuration to prevent repeating yourself in every cy. visit() command.
Read more >
Base Path - next.config.js
Learn more about setting a base path in Next.js. ... When linking to other pages using next/link and next/router the basePath will be...
Read more >
API - ESBuild
This API call is used by the command-line interface if there is at least one input file provided or the --bundle flag is...
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