Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Apr 27, 2024

Conversation

indykoning
Copy link
Contributor

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

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:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Copy link

vercel bot commented Apr 22, 2024

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

@indykoning indykoning changed the title Add fallback error if window.top returns undefined [fix] Add fallback error if window.top returns undefined Apr 22, 2024
@indykoning indykoning changed the title [fix] Add fallback error if window.top returns undefined fix: Add fallback error if window.top returns undefined Apr 22, 2024
@gioboa
Copy link
Member

gioboa commented Apr 23, 2024

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

@gioboa gioboa merged commit 1afc6e2 into QwikDev:main Apr 27, 2024
8 checks passed
@gioboa
Copy link
Member

gioboa commented Apr 27, 2024

Thanks @indykoning for your help 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read properties of null (reading 'Error')
2 participants