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 document.scripts & tests #516

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

burakbasbug
Copy link
Contributor

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

Description

document.scripts (or window.document.scripts)

Accessing document.scripts.length triggers an error because document.scripts yields undefined. This issue arises from attempting to retrieve the length property of an undefined object, causing a code execution error in context of partytown workers.

Use cases and why

Use case: we tried migrating Google publisher tag scripts into Partytown on our website (https://automobile.nau.ch/) and got following error:

image
image

It can be reproduced by running any code that accesses the properties of document.scripts (or window.document.scripts)

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 Dec 20, 2023

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 Dec 20, 2023 10:26pm

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your amazing help @burakbasbug 👏

@gioboa gioboa merged commit eff7438 into QwikDev:main Dec 20, 2023
7 checks passed
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.

2 participants