SolidStart
Prisma.Website.SolidStart runs your SolidStart
project’s Vite build with Nitro’s Node preset. SSR, client assets, and
prerendered pages run on Bun in Prisma Compute from a tar.gz
artifact, not a Docker image.
Install
Section titled “Install”Install the build integration; the resource loads /solidstart and
/solidstart/node from your project:
bun add -d @alchemy.run/frontend-frameworks @vercel/nftnpm install -D @alchemy.run/frontend-frameworks @vercel/nftpnpm add -D @alchemy.run/frontend-frameworks @vercel/nftyarn add -D @alchemy.run/frontend-frameworks @vercel/nftInstall the Nitro plugin dependency too:
bun add @solidjs/vite-plugin-nitro-2npm install @solidjs/vite-plugin-nitro-2pnpm add @solidjs/vite-plugin-nitro-2yarn add @solidjs/vite-plugin-nitro-2Configure Vite
Section titled “Configure Vite”import { solidStart } from "@solidjs/start/config";import tailwindcss from "@tailwindcss/vite";import { defineConfig } from "vite";
export default defineConfig({ plugins: [solidStart(), tailwindcss()],});Alchemy appends nitroV2Plugin() with its Node preset at build time.
Don’t register another Nitro plugin yourself: conflicting instances
fail the build. Put Nitro overrides in the resource’s nitro bag.
Declare the Website
Section titled “Declare the Website”import * as Prisma from "alchemy/Prisma";
export const Website = Prisma.Website.SolidStart("Website", { rootDir: "./app",});Omit rootDir for an app at .. Pass project to share an existing
project; otherwise live deploy creates a database-less Prisma project.
Add it to the Stack
Section titled “Add it to the Stack”import * as Alchemy from "alchemy";import * as Effect from "effect/Effect";
export default Alchemy.Stack( "MySolidStartSite", { providers: Prisma.providers(), state: Alchemy.localState() }, Effect.gen(function* () { const site = yield* Website; return { url: site.url }; }),);site.url is the Compute endpoint on deploy and the local address in dev.
Add environment variables
Section titled “Add environment variables”export const Website = Prisma.Website.SolidStart("Website", { rootDir: "./app", env: { API_BASE: "https://api.example.com" },});Values are applied before build and dev and passed to Compute. Vite
inlines VITE_* keys into the client bundle; keep secrets out of them.
Sibling resource outputs can feed env inside the Stack generator.
Read the environment in server code
Section titled “Read the environment in server code”export function GET() { return new Response(process.env.API_BASE ?? "unset");}API routes, server functions, and SSR run on Bun and read process.env.
Prerendering
Section titled “Prerendering”export const Website = Prisma.Website.SolidStart("Website", { nitro: { prerender: { routes: ["/", "/about"] } },});Nitro emits those pages into .output/public; Compute serves them as
files without invoking SSR. crawlLinks can discover more routes.
The nitro bag accepts serializable options such as route rules and
storage, but the Node target owns preset.
Local dev
Section titled “Local dev”alchemy dev runs SolidStart’s Vite server with HMR; Nitro is not part
of the dev path and the Website creates no Prisma resources. SolidStart
resolves the app root from the working directory, so run one SolidStart
app per dev process.
Opt into the live deployment during dev explicitly:
export const Website = Prisma.Website.SolidStart("Website").pipe( Alchemy.remote(),);Custom domain
Section titled “Custom domain”const site = yield* Prisma.Website.SolidStart("Web", { domain: "app.example.com",});Prisma.CustomDomain requires the app to be on the current default
branch. Configure returned DNS records yourself and verify status before
cutover; see Custom domains.