different-ai/openwork · error

DEN_BASE_URL must be an origin without a path, query, or has

Error message

DEN_BASE_URL must be an origin without a path, query, or hash.

What it means

Error "DEN_BASE_URL must be an origin without a path, query, or hash." thrown in different-ai/openwork.

Source

Thrown at ee/packages/utils/src/den-urls.ts:33

const DEFAULT_PROTOCOL = "https:"

function readDenBaseUrl(env: DenUrlEnvironment): string {
  const value = env.DEN_BASE_URL?.trim()
  if (!value) {
    throw new Error("DEN_BASE_URL must be configured.")
  }
  return value
}

function parseDenBaseUrl(value: string): URL {
  const candidate = value.includes("://") ? value : `${DEFAULT_PROTOCOL}//${value}`
  const url = new URL(candidate)
  if (url.protocol !== "http:" && url.protocol !== "https:") {
    throw new Error("DEN_BASE_URL must use http or https.")
  }
  if (url.pathname !== "/" || url.search || url.hash) {
    throw new Error("DEN_BASE_URL must be an origin without a path, query, or hash.")
  }
  return url
}

function originFromUrl(url: URL): string {
  return url.origin.replace(/\/+$/, "")
}

function apiUrlFor(baseUrl: URL): URL {
  const apiUrl = new URL(baseUrl.href)
  apiUrl.hostname = `api.${baseUrl.hostname}`
  return apiUrl
}

function joinUrl(baseUrl: string, path: string): string {
  return `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`
}

View on GitHub (pinned to 2b7df46e8a)

When it happens

Trigger: Thrown at ee/packages/utils/src/den-urls.ts:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/3c325dd4d7a89677. Report an issue: GitHub.