Start mode dev: server component pages fail to serialize (seroval "[object Object] cannot be parsed")
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vite
- 领域
- backend, build-system, devtools
调研方向
Start with the Vite configuration and the server-component route in src/routes/index.tsx, then reproduce with pnpm dev and curl http://localhost:5173/. Compare the dev SSR module graph with the working vite build && node dist/server/node.js path, focusing on seroval and seroval-plugins externalization and the noExternal workaround. Done means the dev response contains the expected main element without the seroval parse error.
由索引模型根据 Issue 内容生成。
描述
[Opus-5.5] On behalf of Elies
In SSR start mode with serverFunctions: { components: true }, a file route whose page is a server component renders an empty document under vite dev. The server logs SSR_RENDER_ERROR_CONTAINED with a seroval parse error. The production build of the same app renders the page correctly.
Versions: solid-js and @solidjs/web 2.0.0-rc.13, @solidjs/vite-plugin 3.0.0-next.47, @solidjs/router 2.0.0-next.35, filesystem-routing 0.4.0, vite 8.3.2, seroval and seroval-plugins 1.6.8 (one copy installed), Node 24.18, pnpm 10.32, Linux.
Minimal reproduction:
// vite.config.ts
import { defineConfig } from 'vite';
import solid from '@solidjs/vite-plugin';
import { fileRoutes } from 'filesystem-routing/vite';
export default defineConfig({
plugins: [
solid({ start: { node: true }, ssr: true, serverFunctions: { components: true }, extensions: ['.jsx', '.tsx'] }),
fileRoutes({ serverComponents: true }),
],
});
// src/App.tsx
import { pageRoutes } from 'virtual:file-routes';
import { createRouter } from '@solidjs/router';
import { fileRoutes } from '@solidjs/router/fs';
const Router = createRouter({ routes: fileRoutes(pageRoutes) });
export default function App() {
return <Router>{(props) => props.children}</Router>;
}
// src/routes/index.tsx
export default async function Home() {
'use server';
return () => <main>Hello from a server component</main>;
}
Steps: pnpm dev, then curl http://localhost:5173/.
Expected: a document containing <main>Hello from a server component</main>, as vite build && node dist/server/node.js produces.
Actual: the response body is only <!DOCTYPE html>, and the dev server logs:
[SSR_RENDER_ERROR_CONTAINED] Render error outside any boundary — the request failed: Error: Seroval caught an error during the parsing process.
The value [object Object] of type "object" cannot be parsed/serialized.
cause: SerovalUnsupportedTypeError
at parseObjectPhase2 (seroval/dist/dev/index.js)
at Object.stream (seroval-plugins/dist/dev/web-*.js) <- ReadableStreamPlugin
...
at armDocumentLiveHoles (@solidjs/web/frames/dist/server.dev.js)
The failing call is ctx.serialize("sc:live", new ReadableStream(...)) in armDocumentLiveHoles. ReadableStreamPlugin then fails to parse its READABLE_STREAM_FACTORY reference.
Workaround: inlining seroval in the SSR environment fixes dev:
ssr: { noExternal: ['seroval', 'seroval-plugins'] },
That suggests the dev SSR graph gets two seroval module instances. solid-js and @solidjs/web are added to noExternal, while seroval and seroval-plugins stay external, so the reference registered by one instance isn't found by the other. I haven't confirmed that beyond the workaround.
- 主要语言
- TypeScript
- 星标
- 522
- 派生
- 72
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid-vite-plugin 的其他 Issue
-
Test environment detection doesn't consider Vitest workspaces可能已有人在做 @carloitaben 于 43 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
solidjs/solid-vite-plugin#205 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preload可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
solidjs/solid-vite-plugin#391 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
solidjs/solid-vite-plugin#390 ·
维护者通常 1 天内回复
-
Start mode: generated entries render without the CSP nonce, and there is no per-request seam to supply one可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 35/100
solidjs/solid-vite-plugin#388 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
solidjs/solid-vite-plugin#387 ·
维护者通常 1 天内回复
查看 solidjs/solid-vite-plugin 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 76/100
callstackincubator/simlock#350 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
openwatersio/maritime-zones#33 ·
维护者通常 1 天内回复
-
Booking email verification fails for plus aliases with impersonation protection enabled可能已有人在做 @kankadev 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
calcom/cal.diy#30293 · 1 条评论 ·
维护者通常 5 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/DebateAI#611 ·
维护者通常 3 天内回复