Skip to content
Discussion options

You must be logged in to vote

You can resolve this before rendering without putting createAsync inside the document shell. createHandler accepts an async options callback as its second argument. In the current server implementation, SolidStart handles server functions and API routes first, then awaits that callback, and only afterward calls renderToStream/renderToString.

That gives you a page-render-only prepass:

import { createHandler, StartServer } from "@solidjs/start/server";

export default createHandler(
  (event) => (
    <StartServer
      document={({ assets, children, scripts }) => (
        <html lang={event.locals.locale ?? "en"}>
          <head>
            <meta charset="utf-8" />
            <meta name="…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YanAnghelp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants