-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: preview pre-rendered pages #14836
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Someone should run |
I'm not sure if this is a bug? Like you mentioned, it's using This should also be covered in the migration guide though which I missed. EDIT: Unless we say |
In dev, a page is always SSR'd, regardless of whether the user chooses to pre-render that page. In preview, when a page is pre-rendered, the page isn't SSR'd and, instead, its HTML is generated at build time and lives in From that perspective, the discrepancy between dev and preview is very much expected. From a technical point of view, I understand this adds an edge case, but I'd argue it's the correct way to do it. |
Isn't that Vike specific? In build/preview, you can also choose not to prerender some pages, and handle SSR for the requested pages. Or a hybrid mode where some HTML is prerendered, and some not that goes through SSR. IIUC the discrepancy isn't within Vite. |
Yes, exactly, and that's precisely why both is needed: the SSR middleware + serving static
If Vite's preview doesn't serve The purpose of Vite's preview server is to alleviate users and framework authors from implementing their own preview server and re-inventing the wheel. It's specific to Vike and any (future) framework that (will) want to support partial pre-rendering. This isn't a blocker for Vike and I don't mind re-implementing the |
We also talked about this in the meeting and prefer aligning in dev at the meantime. If It also seems like the behaviour you want is the same as So since users can specify |
👍 Makes sense. I tried to make it work with Anyways, the decision to reject this PR makes sense, thus closing. |
Description
The HTML of pre-rendered pages lives in
dist/
, therefore it makes sense to serve.html
files also forappType: 'custom'
.Additional context
This fixes a regression introduced by #14756.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).