moeru-ai/airi · info · Error

Web worker transport is not implemented yet.

Error message

Web worker transport is not implemented yet.

What it means

Thrown by `createPluginContext()` in the web runtime when `transport.kind === 'web-worker'`. Web-worker-based plugin isolation is not yet implemented for the web runtime; only `in-memory` is supported today. This is a placeholder guard marking an unshipped feature.

Source

Thrown at packages/plugin-sdk/src/plugin-host/runtimes/web/index.ts:30

 * Creates the Eventa context used by web-side extension host sessions.
 *
 * Use when:
 * - Bootstrapping a web runtime extension session
 *
 * Expects:
 * - `transport` describes a transport supported by the web runtime
 *
 * Returns:
 * - A web-compatible Eventa context, or throws if the transport is not implemented
 */
export function createPluginContext(transport: PluginTransport): EventContext<any, any> {
  switch (transport.kind) {
    case 'in-memory':
      return createContext()
    case 'websocket':
      throw new Error('WebSocket transport is not implemented for web runtime yet.')
    case 'web-worker':
      throw new Error('Web worker transport is not implemented yet.')
    case 'node-worker':
      throw new Error('Node worker transport is not available in web runtime.')
    case 'electron':
      throw new Error('Electron transport is not available in web runtime.')
    default:
      throw new Error('Unknown plugin transport kind.')
  }
}

View on GitHub (pinned to 27111382b4)

Solutions

  1. Use `createPluginContext({ kind: 'in-memory' })` for web plugin contexts until web-worker support ships.
  2. For off-main-thread work today, host the worker yourself and bridge to an in-memory plugin context via your own messaging.
  3. Await the implementation rather than stubbing the case — the throw is intentional to signal the feature gap.
  4. Double-check the intended runtime: Node/Electron paths may support worker transports that web does not.

Example fix

// before
const ctx = createPluginContext({ kind: 'web-worker', workerUrl })

// after
const ctx = createPluginContext({ kind: 'in-memory' })
Defensive patterns

Strategy: validation

Validate before calling

if (transport.kind !== 'in-memory') {
  throw new Error(`Transport '${transport.kind}' is not supported in the web runtime yet.`)
}
const ctx = createPluginContext(transport)

Type guard

function isSupportedWebTransport(t: PluginTransport): boolean {
  return t.kind === 'in-memory'
}

Try / catch

try {
  ctx = createPluginContext(transport)
} catch (e) {
  if (e instanceof Error && /not implemented/i.test(e.message)) {
    ctx = createPluginContext({ kind: 'in-memory' })
  } else throw e
}

Prevention

When it happens

Trigger: Calling `createPluginContext({ kind: 'web-worker', ... })` (or any equivalent that selects the web-worker transport) in the web runtime. Fires at context construction, before any plugin loads.

Common situations: Attempting to run plugins in a Web Worker for off-main-thread isolation on web; reusing a transport configuration from another runtime that does support workers; experimenting with worker-based plugin hosts prematurely.

Related errors


AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12). Data as JSON: /api/errors/39733964dddfe999. Report an issue: GitHub.