-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
Describe the bug
It's possible to write custom headers and redirects for static requests by including a _headers or _redirects file in a SvelteKit project's /static/ directory.
However, this gets incorrectly included as a retrievable static asset in the _routes.json file and causes:
- requests the path to not render a 404.
- uses up an
includerule which is limited to 100 rules.
Reproduction
Run npm run build and check the output of .svelte-kit/cloudflare/_routes.json. It incorrectly includes the _headers and _redirects files as static requests in _routes.json
Live example
Expected
Navigating to the non-existent URL should trigger the Cloudflare worker and render the 404 page.
Actual
The URL bypasses the Cloudflare worker and returns the root prerendered index.html page.
Logs
No response
Severity
annoyance
Additional Information
No response