langgenius/dify · error · Error

Dev proxy config must include a routes array.

Error message

Dev proxy config must include a routes array.

What it means

Error "Dev proxy config must include a routes array." thrown in langgenius/dify.

Source

Thrown at packages/dev-proxy/src/config.ts:100

  serverConfig: DevProxyServerConfig = {},
  cliOptions: DevProxyCliOptions = {},
): ResolvedDevProxyServerOptions => {
  const configuredPort = cliOptions.port ?? serverConfig.port ?? DEFAULT_PROXY_PORT

  return {
    host: cliOptions.host || serverConfig.host || DEFAULT_PROXY_HOST,
    port: resolvePort(configuredPort),
  }
}

const isRecord = (value: unknown): value is Record<string, unknown> =>
  typeof value === 'object' && value !== null

export function assertDevProxyConfig(config: unknown): asserts config is DevProxyConfig {
  if (!isRecord(config)) throw new Error('Dev proxy config must export an object.')

  if (!Array.isArray(config.routes))
    throw new Error('Dev proxy config must include a routes array.')
}

const resolveDotenvOptions = (
  envFile: DevProxyConfigLoadOptions['envFile'],
  cwd: string,
): DotenvOptions | false => {
  if (!envFile) return false

  const resolvedEnvFilePath = path.resolve(cwd, envFile)
  return {
    cwd: path.dirname(resolvedEnvFilePath),
    fileName: path.basename(resolvedEnvFilePath),
    interpolate: true,
  }
}

const createC12ConfigOptions = (
  configPath = DEFAULT_CONFIG_FILE,

View on GitHub (pinned to ef8544b173)

When it happens

Trigger: Thrown at packages/dev-proxy/src/config.ts:100 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/f3d831a0b9f02019. Report an issue: GitHub.