Skip to content

DF8002: Both devframes and context Passed to initHub

Message

initHub received both devframes and context — the two assembly modes are mutually exclusive.

Cause

initHub assembles a hub in one of two ways: declaratively (devframes: [...] — the instance creates the hub context with its own host and mounts each frame under <base><id>/), or from a pre-built context (context: ctx — your host already created the context and mounted the frames; the instance serves only the hub-level endpoints and transport). A devframes list cannot be mounted into a context whose host the instance doesn't own, so passing both is a contradiction.

Example

ts
// ✗ Bad
initHub({ devframes: [git], context: myCtx })

// ✓ Good — declarative:
initHub({ devframes: [git] })

// ✓ Good — bring your own context:
const ctx = await createHubContext({ host: myHost, cwd })
await mountDevframe(ctx, git)
initHub({ context: ctx })

Fix

Pick one mode. Use configure(ctx) on the declarative mode when you need post-mount registrations (docks, commands, terminals) on the instance-created context.

Source

Released under the MIT License.