-
Notifications
You must be signed in to change notification settings - Fork 216
Cannot call document.cloneNode(true) in content script #577
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
Comments
Vite uses WebComponents for the error overlay, but content scripts don't support WebComponents out of the box. CRXJS adds the polyfill in development but not in production. If you can provide a link to a minimal reproduction repo, I'll be able to offer better advice. |
Hey @jacksteamdev, appreciate your help here again. Here is a reproduction: https://github.com/rbhalla/crxjs-bug-repro/tree/document-clone-node-bug I guess this is technically a problem with the polyfill, but considering it doesn't play nicely with content scripts, I wonder if there's a way to not enable that functionality? My experience with vite integration is poor so it's possible my understanding is flawed here. Keen to hear your take! |
I am facing the same issue. |
Ran into the same issue. @jacksteamdev is there a workaround? |
same issue, may you kindly describe how this issue happens, so that i will try to fix it. |
Facing the same issue. Anyone knows how to fix this? |
Here's a hacky workaround:
|
Here's another workaround:
Compared to |
Build tool
Vite
Where do you see the problem?
Describe the bug
I am not able to called
document.cloneNode(true)
in a content script.It seems like this is a result of the webcomponents polyfill. Not something I was bumping into when using rollup.
It seems like in the prod build (using
vite build
) this problem doesn't occur.To clarify, I am not explicitly including this library or explicitly using web components.
Logs
System Info
Severity
blocking all usage of RPCE
The text was updated successfully, but these errors were encountered: