feat: add support for <Head> component (#67)
This component only works during SSR, during the inital render. It does not work on renders inside a suspense boundary, or client renders.
This commit is contained in:
@@ -159,8 +159,15 @@ export class ServerContext {
|
||||
});
|
||||
const bodyStream = new ReadableStream<Uint8Array>({
|
||||
async start(controller) {
|
||||
for await (const chunk of body) {
|
||||
controller.enqueue(new TextEncoder().encode(chunk));
|
||||
try {
|
||||
for await (const chunk of body) {
|
||||
controller.enqueue(new TextEncoder().encode(chunk));
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Rendering failed:\n", err);
|
||||
controller.enqueue(
|
||||
new TextEncoder().encode("500 Internal Server Error"),
|
||||
);
|
||||
}
|
||||
controller.close();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user