moeru-ai/airi · error

The Base URL is not an absolute http:// or https:// address.

Error message

The Base URL is not an absolute http:// or https:// address.

What it means

buildUrl's URL constructor threw because the configured baseUrl is not an absolute http(s) address (missing scheme, empty, or malformed). request catches that low-level TypeError and rethrows this clearer validation error before any network call, so the user fixes the Base URL instead of seeing an opaque URL failure.

Source

Thrown at packages/provider-inference/src/providers/local/voicevox/engine.ts:189

  const body = await response.text()
  try {
    return JSON.parse(body) as T
  }
  catch {
    throw new Error(`Speech engine answered /${endpoint} with a body that is not JSON. Check that the Base URL points at a VOICEVOX-compatible engine.`)
  }
}

async function request(
  engineRequest: VoicevoxEngineRequest,
  options?: VoicevoxEngineRequestOptions,
): Promise<Response> {
  let url: URL
  try {
    url = buildUrl(engineRequest)
  }
  catch {
    throw new Error('The Base URL is not an absolute http:// or https:// address.')
  }

  const doFetch = options?.fetch ?? globalThis.fetch
  const response = await doFetch(url, {
    method: POST_ENDPOINTS.has(engineRequest.endpoint) ? 'POST' : 'GET',
    // No engine in the family redirects. A redirect therefore means the Base URL
    // points at something else, and following it would hide that.
    redirect: 'error',
    signal: options?.signal,
    ...(engineRequest.body === undefined
      ? {}
      : { body: JSON.stringify(engineRequest.body), headers: { 'Content-Type': 'application/json' } }),
  })

  if (!response.ok) {
    const detail = (await response.text()).trim()
    const suffix = detail ? `: ${detail.slice(0, 200)}` : ''
    throw new Error(`Speech engine answered ${response.status} ${response.statusText} for /${engineRequest.endpoint}${suffix}`)

View on GitHub (pinned to f679616c34)

Solutions

  1. Set an absolute Base URL starting with http:// or https:// in the provider configuration
  2. Trim whitespace and add the missing scheme (e.g. http://127.0.0.1:50021)
  3. Validate the URL in settings UI before saving to catch this earlier
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/provider-inference/src/providers/local/voicevox/engine.ts:189 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of moeru-ai/airi@f679616c34 (2026-09-08). Data as JSON: /api/errors/5586035d640cad6e. Report an issue: GitHub.