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

Prevent Partytown integration from inserting a 'null' string into the body #11829

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

oosawy
Copy link
Contributor

@oosawy oosawy commented Aug 24, 2024

Changes

When using astro/partytown with astro:transitions, if partytown failed to load, it inserts "null" string into the page during transition. This mainly occurs in non-Secure Context where Service Worker that partytown needs can't be install. For example, if you're accessing it via an IP address on a LAN during development, it isn't served over HTTPS or on localhost so it's not Secure Context.

This PR prevent that by append a element only if found.

image
― The script going to append "null"

image
― The added "null" string node

Testing

Building @astrojs/partytown, linking it to my project, and confirming no "null" were inserted during page transitions.

Docs

This should be a minor bug fix affecting only special cases, so no docs will be required.

Copy link

changeset-bot bot commented Aug 24, 2024

🦋 Changeset detected

Latest commit: 42f633e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Aug 24, 2024
@oosawy oosawy changed the title Prevent Partytown from inserting a 'null' string into the body Prevent Partytown integration from inserting a 'null' string into the body Aug 24, 2024
@bluwy bluwy merged commit f1df1b3 into withastro:main Aug 26, 2024
11 of 13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants