Skip to content

DF8003: connectionMeta() Before Hub Instance Ready

Message

connectionMeta() was called before initHub finished initializing.

Cause

initHub is a synchronous factory that kicks off asynchronous initialization eagerly — creating the hub context, mounting every frame, and binding the WebSocket tier. connectionMeta() describes the WebSocket binding, which only exists once that initialization completes; calling it earlier has nothing correct to return.

Example

ts
import { initHub } from '@devframes/hub/initiate'

const hub = initHub({ devframes: [git] })
hub.connectionMeta() // ✗ throws DF8003 — init is still in flight

await hub.ready
hub.connectionMeta() // ✓ { backend: 'websocket', websocket: { … } }

Fix

Await instance.ready (or any request through instance.handler — it awaits readiness internally) before reading connectionMeta().

Source

Released under the MIT License.