You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works locally. As expected, clicking the "Next page" button will navigate to the next page and new data will show.
However when deployed (with Vercel), the page will navigate with the query parameters, but the query parameters are not sent to the API. I'm not sure if this is a Vercel problem, an Astro problem, or a me problem.
In the StackBlitz example, it's even simpler and doesn't function as I'd expect.
What's the expected result?
I expect query parameters to consistently hold the state. In the StackBlitz, I expect the query parameter to increment. I expect this to work in production. What am I missing?
With the default output: 'static' option, Astro.request.url does not contain search parameters, like ?foo=bar, as it’s not possible to determine them ahead of time during static builds. However in output: 'server' mode, Astro.request.url does contain search parameters as it can be determined from a server request.
I tested locally and you can't access the searchParams either, which is intended as the page is prerendered and can't read the search params ahead of time. I'll close this for now as further explained by Ema as why this works the way it is.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using query parameters for navigation, in production we lose the query parameters. Take this simple page for example:
This works locally. As expected, clicking the "Next page" button will navigate to the next page and new data will show.
However when deployed (with Vercel), the page will navigate with the query parameters, but the query parameters are not sent to the API. I'm not sure if this is a Vercel problem, an Astro problem, or a me problem.
In the StackBlitz example, it's even simpler and doesn't function as I'd expect.
What's the expected result?
I expect query parameters to consistently hold the state. In the StackBlitz, I expect the query parameter to increment. I expect this to work in production. What am I missing?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-pdcl2d?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: