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

document.body.classList is not iterable in partytown. Which cause spread operator to fail (amongst probably many other side effects). #257

Closed
1 task
linuxd3v opened this issue Sep 21, 2022 · 1 comment
Labels

Comments

@linuxd3v
Copy link

linuxd3v commented Sep 21, 2022

  • I am interested in helping provide a fix!

Describe the bug
document.body.classList is not iterable object in partytown. Which then cause spread operator to fail (amongst probably many other side effects).
I get this error:

    const bodyClassValues = [...document.body.classList];
 TypeError: document.body.classList is not iterable
at Proxy.eval (eval at run (partytown-ww-sw.js?v=0.7.0:689:9), <anonymous>:18:51)
at run (partytown-ww-sw.js?v=0.7.0:689:37)
at runScriptContent (partytown-ww-sw.js?v=0.7.0:677:13)
at partytown-ww-sw.js?v=0.7.0:1686:54
at receiveMessageFromSandboxToWorker (partytown-ww-sw.js?v=0.7.0:1690:1

To Reproduce
Steps to reproduce the behavior:
This simple script will cause exception in the browser:

<script type="text/partytown">
        const bodyClassValues = [...document.body.classList];
</script>

Reproduction link
https://github.com/linuxd3v/partytown-iterable
^clone it, open index.html in browser - and you will see error in console.

Expected behavior
Objects that are usually iterable should be iterable with partytown and should not throw exceptions.

Partytown version
0.7.0

Screenshots
image

Additional context
I'm running into this issue with cafemedia and adthrive scripts.

Copy link
Contributor

Partytown moves to QwikDev organization, this is a new beginning for the project. So it's time to clarify the status and clean up the current state a bit. This issue was automatically marked as deprecated and closed because it was not detected recent activity for 8 months, date of latest version. If this issue is still relevant, feel free to comment below and the maintainers will reopen it. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 24, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant