---
outline: deep
---

# 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({ base: '/__devframes/', devframes: [git], context: myCtx })

// ✓ Good — declarative:
initHub({ base: '/__devframes/', devframes: [git] })

// ✓ Good — bring your own context:
const ctx = await createHubContext({ host: myHost, cwd })
await mountDevframe(ctx, git)
initHub({ base: '/__devframes/', 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

- [`packages/hub/src/node/initiate.ts`](https://github.com/devframes/devframe/blob/main/packages/hub/src/node/initiate.ts) — `initHub` throws this during initialization when both options are present.
