langgenius/dify · error · Error

Dev proxy config must export an object.

Error message

Dev proxy config must export an object.

What it means

Error "Dev proxy config must export an object." thrown in langgenius/dify.

Source

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

}

export const resolveDevProxyServerOptions = (
  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,
  }
}

View on GitHub (pinned to ef8544b173)

When it happens

Trigger: Thrown at packages/dev-proxy/src/config.ts:97 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/5ddcc5e6d2109c54. Report an issue: GitHub.