opengovsg / starter-kit

A technical kit to quickly build new products
https://start.open.gov.sg
MIT License
36 stars 6 forks source link

feat(trpc): use fetch fn that directs to window.fetch #225

Closed LoneRifle closed 10 months ago

LoneRifle commented 10 months ago

Problem

By default, tRPC will retain its own reference to window.fetch on init. Any changes to or replacements of window.fetch would not be picked up by tRPC, which will affect eg, instrumentation by Datadog RUM.

Solution

Fix this by supplying our own fetch implementation that delegates to whatever is the current global fetch().

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starter-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 9:22am