-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Query params trigger the trailingSlash
error in preview mode
#8942
Comments
Is this for a static site? Normally, an adapter would be necessary for making use of query params. In that case, the adapter would handle the preview mode and its url handling. |
Yes, it is static, however using query parameters in the URL allows me to save the search history that was inputted by the user on the search page. I use I can't think of a better way to implement client-side site-wide search that can be preserved between tab reloads and shared with others |
|
You're right, the search page really does not exist. The issue is still visible though - the dev server thinks search params should end with a slash. Going to an arbitrary url with arbitrary search params should surface that. |
Yeah, I did this:
Oh wait do you mean directly go to homepage/?test=10 instead of clicking it? |
No, that screen should appear immediately after clicking on the button. That's strange I just did it minutes ago and it appeared for me |
Can you re-try that? I tried that when I commented 3 hours ago and your code just worked fine. |
Wait, let me do it again and record it |
Purely, my bad. I was trying different combinations and I left the configuration set to trailingSlash: 'never' where this worked. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
n/a
Describe the Bug
When navigating to for example
http://localhost:4321/search/?q=hask
while runningastro preview
an error is shown:What's the expected result?
The page should be shown normally
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rj7etb?file=src%2Flayouts%2FLayout.astro
Participation
The text was updated successfully, but these errors were encountered: