deepseek-ai/deepseek-harness · error · Error

typert-loader: ctx.baseUrl is unset — the loader needs the…

Error message

typert-loader: ctx.baseUrl is unset — the loader needs the config-tree anchor to resolve plugin packages

What it means

The loader plugin activated without `ctx.baseUrl`, which it uses as the resolution anchor for plugin package paths. Without the config-tree anchor it cannot resolve any package, so it fails loud at activation rather than silently loading nothing.

Solutions

  1. Set ctx.baseUrl by loading the config through the standard cordis loader so the config-tree anchor exists.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/typert/loader/src/index.ts:290 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/92684ea038898a71. Report an issue: GitHub.

Appendix: source

Thrown at packages/typert/loader/src/index.ts:290

    || !('_zod' in codec.schema)
    || typeof (codec.schema as { parse?: unknown }).parse !== 'function') {
    throw new Error(`typert-loader: ${pkgName} ${subject} is not backed by a zod v4 schema`)
  }
}

/**
 * Scan current Loader entries during activation, then follow entry mounts and
 * unmounts for this plugin's lifetime.
 * @param ctx - plugin context carrying `typert` and `loader`.
 * @param config - explicit package artifacts in addition to Loader entries.
 */
export async function apply(ctx: Context, config: Config): Promise<void> {
  // Resolution anchor: the config tree's baseUrl (the cordis.yml directory,
  // whose package declares every composed plugin as a dependency). This
  // package's own URL would miss sibling packages under pnpm's isolated
  // node_modules.
  if (ctx.baseUrl === undefined) {
    throw new Error('typert-loader: ctx.baseUrl is unset — the loader needs the config-tree anchor to resolve plugin packages')
  }
  const require = createRequire(ctx.baseUrl)
  const configured = new Set((config as ResolvedConfig).packages)

  // Registered contributions by entry name; the disposer withdraws the entry's registration.
  const registered = new Map<string, () => Promise<void>>()
  // In-flight import/register tasks by entry name.
  const pending = new Map<string, Promise<void>>()
  // Artifact paths by package name. Negative verdicts (unresolvable specifier —
  // loader builtins, subpath rows — or no typert export) are cached as null and
  // never expire: plugin-set changes take effect on restart.
  const artifactPath = new Map<string, string | null>()
  // Imported+validated manifests by package name (one import per package per process).
  const manifests = new Map<string, Promise<TypertContribution>>()
  const dirty = new Set<string>()
  let flushQueued = false
  let active = true
  ctx.effect(function* () {

View on GitHub (pinned to b150a551b8)