{"record":{"id":"5ddcc5e6d2109c54","repo":"langgenius/dify","slug":"dev-proxy-config-must-export-an-object","errorCode":null,"errorMessage":"Dev proxy config must export an object.","messagePattern":"Dev proxy config must export an object\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev-proxy/src/config.ts","lineNumber":97,"sourceCode":"}\n\nexport const resolveDevProxyServerOptions = (\n  serverConfig: DevProxyServerConfig = {},\n  cliOptions: DevProxyCliOptions = {},\n): ResolvedDevProxyServerOptions => {\n  const configuredPort = cliOptions.port ?? serverConfig.port ?? DEFAULT_PROXY_PORT\n\n  return {\n    host: cliOptions.host || serverConfig.host || DEFAULT_PROXY_HOST,\n    port: resolvePort(configuredPort),\n  }\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n  typeof value === 'object' && value !== null\n\nexport function assertDevProxyConfig(config: unknown): asserts config is DevProxyConfig {\n  if (!isRecord(config)) throw new Error('Dev proxy config must export an object.')\n\n  if (!Array.isArray(config.routes))\n    throw new Error('Dev proxy config must include a routes array.')\n}\n\nconst resolveDotenvOptions = (\n  envFile: DevProxyConfigLoadOptions['envFile'],\n  cwd: string,\n): DotenvOptions | false => {\n  if (!envFile) return false\n\n  const resolvedEnvFilePath = path.resolve(cwd, envFile)\n  return {\n    cwd: path.dirname(resolvedEnvFilePath),\n    fileName: path.basename(resolvedEnvFilePath),\n    interpolate: true,\n  }\n}","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/packages/dev-proxy/src/config.ts#L79-L115","documentation":"Error \"Dev proxy config must export an object.\" thrown in langgenius/dify.","triggerScenarios":"Thrown at packages/dev-proxy/src/config.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}