-
-
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
Static File Endpoints broken with trailingSlash: "always"
in development
#10149
Comments
Are they broken only in development (just to understand, obviously this is still very important). |
Yes, the issue only occurs in dev mode. |
I'll look into it |
Hi @kripod, we talked about this internally. This isn't a bug. We actually fixed that bug, and now the routing behaves consistently. As you set I suggest using We will monitor the situation and see if this bugfix impacts too many users. |
@ematipico I think my issue report may have been misunderstood. Trailing slashes are a valid requirement for most API endpoint URLs, except for the ones which are meant to serve static files, e. g. |
We've been having this issue for months. We have a search.json.ts static file endpoint in the pages dir. In prod we need to not add a trailing slash to the end of the route and in dev we need to make sure there is a trailing slash. It's not an optimal situation. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Since
[email protected]
, Static File Endpoints return 404 in development (runningastro dev
) whentrailingSlash: "always"
is set in the Astro config.What's the expected result?
Static File Endpoints should work as they did before merging #9597.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-fy7uro?file=src%2Fpages%2Ftest.json.js
Participation
The text was updated successfully, but these errors were encountered: