Error reference
Most of mycl’s runtime checks throw in production as compact coded errors
of the form mycl: error <code>, visit https://mycl.dev/errors/<code> for more information.: the full message strings are stripped from production
bundles to keep them small. A few validation checks (errors 9, 10, 11, 12, 13, 15, 16)
are development-only, where the guard itself is stripped from production
builds entirely, so those codes can never fire there. In development the
complete message is thrown (or logged) inline for every code. Each page below
states its own production behavior explicitly.
| Code | Message |
|---|---|
| 1 | mycl: capability “{name}” called outside any registry scope. Wrap the call site with scope(), or use snapshot() before async boundaries. |
| 2 | mycl: capability “{name}” resolved to a non-function value. Check your LayerStrategy.extract. It must return a function. |
| 3 | mycl: invalid channel |
| 4 | mycl: registered symbol (Symbol.for) cannot key the dispatch cache — use a unique Symbol() |
| 5 | layer: target must be a capability |
| 6 | layer: value cannot be undefined |
| 7 | augment: target must be a capability |
| 8 | augment: wrapper must be a function |
| 9 | augment: received a builder (h => …) instead of a wrapper. Pass the wrapper directly: augment(cap, after(fn)). |
| 10 | augment: wrapper threw during canary probe — wrappers must be pure composition and not throw on application. Caught: {caught} |
| 11 | mycl: identifier path must be a non-empty string, got “{identity}“. |
| 12 | mycl: channel name “{name}” must not contain a ”:” or ”/” separator. |
| 13 | mycl: duplicate capability identifier “{identity}”: two capabilities resolve to the same identifier. Most likely a duplicate copy of the package that creates it (nested install or dual ESM+CJS load, run pnpm dedupe); otherwise two packages collide on the same identifier path. |
| 14 | mycl: alsContext requires process.getBuiltinModule (Node 20.16 or newer, or a runtime that provides it). Use stackContext for synchronous scoping, or install your own ScopeContext via setChannelContext. |
| 15 | mycl: merge() received an already-resolved registry, which cannot be re-composed. Pass it as the sole scope source instead: scope(fn, resolved) or mycl(make, resolved). |
| 16 | mycl: this ScopeContext instance already backs channel “{name}”. A context belongs to one channel (sharing one collapses their scopes); mint a fresh context per channel. |