-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
APIRoute vs public files follow different precedence in dev and build #15165
Copy link
Copy link
Closed
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)
Description
Astro Info
Astro v5.16.6
Vite v6.4.1
Node v22.18.0
System Windows (x64)
Package Manager npm
Output static
Adapter none
Integrations @astrojs/sitemap (v3.6.0)
If this issue only occurs in one browser, which browser is a problem?
all
Describe the Bug
If filename of a file in public/ dir is same as filename produced by APIRoute in root,
Example
public/robots.txt exists
src/pages/robots.txt.ts exists
Difference in behaviour:
astro dev: public route takes precedenceastro build: pages route takes precedence
Normal behaviour if no conflicting routes (i.e., only one of those files exists)
What's the expected result?
Not documented as per my knowledge: https://docs.astro.build/en/guides/routing/#route-priority-order
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rfjccbca
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)