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

Add workaround for exporting wp.i18n to worker #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

westonruter
Copy link
Owner

@westonruter westonruter commented Sep 29, 2024

When attempting to make wp.i18n available in a Worker, Partytown throws an error when attempting to access wp.i18n.__() because it is blocking the serialization of any property name that begins with "_". This is a workaround to prevent this from happening. It seems Partytown needs to conditionally prevent serializing these underscore-prefixed members based on the object that is being serialized.

This works around the bug I filed at BuilderIO#629

Note that I built the JS with npm run build and not npm run build.prod. This prevents the scripts in the debug directories from being minified.

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.

1 participant