Serialization

Server function arguments and return values are serialized so they can travel between server and client.


Configuration

Set the mode on solidStart() in vite.config.ts:

import { defineConfig } from "vite";
import { solidStart } from "@solidjs/start/config";
export default defineConfig({
plugins: [
solidStart({
serialization: { mode: "json" },
}),
],
});

Modes

  • json: deserializes with JSON.parse on the client. It avoids eval, so it fits a strict CSP. This is the default.
  • js: a smaller binary format that needs eval on the client, which a strong CSP blocks.

If your app enforces a Content Security Policy, keep json.


Last updated: 7/4/26, 5:28 PMEdit this pageReport an issue with this page