{"record":{"id":"b982daa32725fdde","repo":"deepseek-ai/deepseek-harness","slug":"browser-time-zone-is-unavailable","errorCode":null,"errorMessage":"browser time zone is unavailable","messagePattern":"browser time zone is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/client/runtime/src/client/time-zone.ts","lineNumber":11,"sourceCode":"/** Browser-owned time-zone sampling for prompt RPC provenance. */\n\n/**\n * Resolve the current browser IANA zone for one outbound operation.\n * @returns The browser-provided canonical zone.\n * @throws when the runtime cannot provide a non-empty zone.\n */\nexport function resolvedClientTimeZone(): string {\n  const timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone\n  if (typeof timeZone !== 'string' || timeZone.length === 0) {\n    throw new Error('browser time zone is unavailable')\n  }\n  return timeZone\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/runtime/src/client/time-zone.ts#L1-L15","documentation":"resolvedClientTimeZone() samples the browser's IANA zone through new Intl.DateTimeFormat().resolvedOptions().timeZone to attach provenance to outbound prompt RPCs, and throws when the runtime yields anything but a non-empty string. This is an environment-capability error: the engine lacks timezone data (small-ICU builds, stripped WebViews, old browsers) or an Intl polyfill omits timeZone, so no canonical zone can be reported and the library refuses to invent one.","triggerScenarios":"Any prompt path that calls resolvedClientTimeZone() in a runtime whose Intl cannot resolve a zone: Node built with small-icu, minimal embedded WebViews, old Safari or Chrome, or jsdom/partial-Intl polyfill environments where resolvedOptions().timeZone is undefined or an empty string.","commonSituations":"Running the web client in a stripped-down embedded browser; CI or container images shipping small-icu Node without tzdata; older mobile WebViews; test environments that polyfill Intl partially.","solutions":["Run the environment with full ICU and timezone data: upgrade the browser, use a full-icu Node build (or install full-icu / tzdata in the image), and set a valid TZ","Preflight the capability once at boot — String(new Intl.DateTimeFormat().resolvedOptions().timeZone || '').length > 0 — and route to an explicit zone when it fails","Catch the throw at the call site and send a user-chosen explicit zone instead of the sampled one","Do not paper over it with a silent default inside shared code; keep the fallback explicit where the zone is consumed"],"exampleFix":"// before\nconst zone = resolvedClientTimeZone()\n\n// after — preflight the capability, fall back to an explicit zone\nconst sampled = new Intl.DateTimeFormat().resolvedOptions().timeZone\nconst zone = typeof sampled === 'string' && sampled.length > 0 ? sampled : 'UTC'","handlingStrategy":"fallback","validationCode":"const sampled = new Intl.DateTimeFormat().resolvedOptions().timeZone\nconst zone = typeof sampled === 'string' && sampled.length > 0\n  ? resolvedClientTimeZone() // guaranteed to succeed now\n  : 'UTC' // explicit fallback; this runtime cannot produce a sampled zone","typeGuard":"function hasResolvedTimeZone(): boolean {\n  const tz = new Intl.DateTimeFormat().resolvedOptions().timeZone\n  return typeof tz === 'string' && tz.length > 0\n}","tryCatchPattern":null,"preventionTips":["Ship or require full-ICU builds in embedded and CI runtimes","Preflight the Intl capability once at boot and cache the decision","Keep the fallback explicit at the call site — the library deliberately refuses to invent a zone"],"tags":["intl","timezone","environment","icu"],"backgroundTag":"intl-timezone-unavailable","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}