← 报错百科

Cache · FiberFailure · Service

这是线索,不是结论。 内容由机器从检索到的中文译文合成,尚未经人确认;引用是提问那一刻的快照, 译文更新后可能过时。每条都附了可点回原文的链接 —— 请核对后再采用。 发现不对请 提 issue

报错原文

(FiberFailure) Error: Service not found: Cache (defined at <anonymous> (<project>/apps/api/seed-cases/11-service-not-found.ts:9:40))
    at <project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/fiberRuntime.ts:1112:36
    at <anonymous> (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/fiberRuntime.ts:1161:41)
    at body (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/Utils.ts:786:14)
    at FiberRuntime.Sync (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/fiberRuntime.ts:1161:19)
    at <anonymous> (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/fiberRuntime.ts:1398:53)
    at Object.f (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/tracer.ts:101:19)
    at FiberRuntime.runLoop (<project>/node_modules/.pnpm/effect@3.22.2/node_modules/effect/src/internal/fiberRuntime.ts:1384:34)

诊断

最可能的原因:这个 Effect(或其依赖链)需要 `Cache` 这个 Service,但运行时没有为它提供对应的 Layer,于是 Effect 的 requirements 未被满足,抛出 `Service not found: Cache`(证据 1 正是这种情况的反面:Effect 依赖某 Service 时,必须为该 Effect 提供这个 Service)。 修复方向:检查构建 Effect 的地方,确认提供 `Cache` 的 Layer 已通过 Layer 组合/提供的方式真正接入了这条执行链(例如被 `provide` 的 Layer 里

依据(3 条站内译文)

你也被这个报错卡住了?

你自己的报错整段贴到报错诊断 —— 它提取的 API 名与类型名来自你的实际代码,比照抄别人的诊断更准; 诊断完也会并进这一条(同一报错算同一条)。

本页来自 2026-09-13 的快照(https://effect-ts.cn)。来自站内 /debug 的真实诊断,按报错签名归并(绝对路径/行列号/堆栈帧已归一)。条目为机器生成、未经人审(reviewed 字段),引用是提问那一刻的快照。