QwikDev / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.qwik.dev
MIT License
13.09k stars 437 forks source link

fix: Add fallback error if window.top returns undefined #586

Closed indykoning closed 6 months ago

indykoning commented 7 months ago

What is it?

Description

Fixes: #226 In some setups like Turbo window.top might no longer exist when checking if serializedValue Is Error while otherwise it is running fine. This adds a fallback to an earlier stored Error Object so this error doesn't occur and normal analytics can proceed.

Checklist:

vercel[bot] commented 7 months ago

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

Name Status Preview Comments Updated (UTC)
partytown ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 1:30pm
gioboa commented 7 months ago

Hi @indykoning thanks for your PR, can you fix the test pls?

gioboa commented 6 months ago

Thanks @indykoning for your help :rocket: