Skip to content
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

Fix: Project defined routes are prioritized over internal and external routes in dev #13117

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

joshmkennedy
Copy link

Changes

This PR is an attempt to fix #13091.

I added a rule to the routeComparator function that ensures project defined routes will be sorted before internal or external routes.

Testing

I added a test that checks that the dynamic routes are sorted before the static internal 404 route.

Docs

This shouldn't affect a user's behavior, as creating /404.astro was already prioritized.

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 31, 2025
Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 36885a0

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codspeed-hq bot commented Jan 31, 2025

CodSpeed Performance Report

Merging #13117 will not alter performance

Comparing joshmkennedy:fix-dynamic-404-route (36885a0) with main (2a85bd7)

Summary

✅ 6 untouched benchmarks

@ematipico
Copy link
Member

The user reported that the issue occurs in dev only, so the fix should be in the vite dev server plugin

@joshmkennedy joshmkennedy changed the title Project defined routes are prioritized over internal and external routes Fix: Project defined routes are prioritized over internal and external routes in dev Feb 1, 2025
@joshmkennedy
Copy link
Author

This may not be the fix, as this is affecting services like islands and images. I'll look to add a fix that affects just the default 404 route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/404 route doesn't work in astro dev when created via a content loader
2 participants