-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(hybrid-output): no matched route when using getStaticPaths
#7150
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
getStaticPaths
getStaticPaths
getStaticPaths
getStaticPaths
We were discussing about testing recently, and would want to prevent duplicated test since it's getting slower. Would it be possible to share a single fixture to test it? Besides that, the code changes looks good to me! |
I guess I could use a vite plugin to remove the |
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.
Thanks for the test refactors!
Changes
Fix #7140
With the original prerendering feature, we had to export a
prerender
constant in order to prerender a page. Because of that we could get the prerendering state of a module by accessing itsprerender
export (mod.prerender
)With the new hybrid rendering feature however, we can't do that because it doesn't require a
prerender
export.To get the
prerender
state of a route we should retrieve it from the metadata set by theastro:scanner
vite plugin, which should erase inconsistencies on that front between dev and build.Testing
Copy the test fixtures of
ssr-prerender-get-static-paths
, and remove theexport const prerender = true
from pages/endpoints.In this case, creating a new test fixture seems like the easier choice.
Also fixed the old prerender tests, which weren't actually testing the prerendering feature.
Docs
Bug fix, N/A