ta
TanStack
GitHub
ai
Workspace
GitHub
CI Pipeline Executions
Filtered
Runs
Demo
Insights
Compare tasks
Analytics
Sign in
Toggle sidebar
Overview
⌘K
ai
Loading workspace stats
Loading workspace insights...
Statistics interval
7 days
30 days
Latest CI Pipeline Executions
Status
Fix filter
Filter
Fuzzy
Filter range
Sort by
Sort by
Start time
Sort ascending
Sort descending
Succeeded
667-tanstackai-event-client-generates-a-random-runtime-id-at-module-scope-crashing-on-cloudflare-workers-edge-runtimes
e0413032 fix(ai-event-client): defer devtools runtime-id generation to first use The runtime id was seeded at module scope via a top-level IIFE calling crypto.randomUUID() / Math.random(). Because @tanstack/ai's chat() always pulls in the devtools middleware, this random-value generation ran at module-evaluation time. Edge runtimes such as Cloudflare Workers forbid generating random values in global scope, so importing chat() crashed the Worker with "Disallowed operation called within global scope". Generate the runtime id lazily on first use (inside getAIDevtoolsRuntimeId() / createAIDevtoolsEventEnvelope()) and memoize it, so evaluating the module performs no random-value generation. The cross-bundle global and the generated values are unchanged. Fixes #667. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
by Tom Beckenham
T
Succeeded
667-tanstackai-event-client-generates-a-random-runtime-id-at-module-scope-crashing-on-cloudflare-workers-edge-runtimes
e0413032 Merge 144a376deaed7425e00db3865d3992b452c4c056 into 86cf41c5ea994a7086e976f742d12cbf09cfce3e
by Tom Beckenham
T
Previous
Next