Skip to content

[🐞] createContextualFragment does not work as expected with partytown #667

@ilja-gusiatin

Description

@ilja-gusiatin

Describe the bug

3rd party script (onetrust) that I want to load via partytown tries to insert element using document.createRange().createContextualFragment() and fails.

Expected:
Result of createContextualFragment() is #document-fragment

Actual:
Result of createContextualFragment() is Proxy(WorkerBase)

Image

Reproduction

https://github.com/ilja-gusiatin/partytown-create-contextual-fragment

Steps to reproduce

Please use the following repo as a sandbox to reproduce the issue:
https://github.com/ilja-gusiatin/partytown-create-contextual-fragment/blob/main/README.md

Browser Info

Chrome, Safari

Additional Information

Partytown version: 0.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions