-
Notifications
You must be signed in to change notification settings - Fork 176
fix: populate static API routes for our staticRouteMatcher #875
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
Conversation
🦋 Changeset detectedLatest commit: b04012e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
commit: |
aa034ed to
dba57b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks
|
Thanks for the reviews @conico974 ! |
Next filters out all static routes that starts with
/apion this line fromroutes-manifest.json.This makes both static API routes from page router and app router (including page.tsx in
/api/*on app router) not get caught by ourstaticRouteMatchercause it relies onroutes-manifest.jsonto have those routes. If you had a catch-all route at the root (i.e:/[[...catch-all]].tsx) withfallback: falseit would break all API routes causehandleFallbackFalseinroutingHandlerwould return a 404. In this PR we include those routes and can also get rid ofisApiRouteinroutingHandler. As it wont be needed anymore.I added an E2E to
app-pages-routerto showcase this. Without the fix in this PR thetests-e2e/tests/appPagesRouter/api.test.tswould fail, and possibly more. As we would get a 404 instead.Reference for the Discord thread