-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
injectRoute
request url is missing search params
#9737
Comments
Is it the same for |
This is expected in static output. |
It works if you set output to server, the dev server is acting according the configuration. Feel free to reopen if you think there is still an issue. |
thank you @lilnasy for the clarification. Looking at this: https://github.com/withastro/astro/blob/53c69dcc82cdf4000aff13a6c11fffe19096cf45/packages/astro/src/assets/endpoint/node.ts seems like the request has the search params. How is this working without having to change the output? |
|
What I said earlier was incorrect. The node endpoint is used both by the node adapter and the dev server which special cases astro/packages/astro/src/vite-plugin-astro-server/request.ts Lines 46 to 47 in 53c69dc
|
@lilnasy So basically there is no way to make it work right? I can't use search params and neither path params because Is there any possibilities to change the codebase to be more flexible? like for instance using this check |
I'm guessing what you want is this: Your issue prompted a discussion of possible options in our discord: |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Example:
index.ts
endpoint.ts
In this
GET
request theurl.searchParams
is empty even though the url has some.What's the expected result?
url.searchParams
should be filled with the url paramsLink to Minimal Reproducible Example
https://codesandbox.io/p/devbox/astro-injected-route-jvptjh
Participation
The text was updated successfully, but these errors were encountered: