Files
foka-ci/docs/pitfalls.md
2026-01-11 11:59:04 +08:00

22 lines
864 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 踩坑指南 (Pitfalls)
## 1. Prisma 客户端生成
- **现象**: 修改 `schema.prisma` 后代码报错找不到类型。
- **解决**: 需要在 `apps/server` 下运行 `pnpm prisma generate`。本项目将生成的代码放在了 `generated/` 目录而非 node_modules请注意引用路径。
## 2. zx 环境变量继承
- **现象**: 在流水线脚本中找不到 `node``git` 命令。
- **解决**: `PipelineRunner` 在调用 `zx` 时必须手动扩展 `env: { ...process.env, ...userEnv }`,否则会丢失系统 PATH。
## 3. Koa BodyParser 顺序
- **现象**: 获取不到 `ctx.request.body`
- **解决**: `koa-bodyparser` 中间件必须在 `router` 中间件之前注册。
## 4. SQLite 并发写入
- **现象**: 部署日志极快输出时偶发 `SQLITE_BUSY`
- **解决**: 适当增加 `better-sqlite3` 的 busy timeout。