Using Vike + SSG in a Shadow DOM context #2031
Unanswered
timbolimboslice
asked this question in
Help & Questions
Replies: 1 comment
-
Indeed, Vike has a hard requirement for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Vike to create small components that are deployed to a Netlify site. I have another website (in WordPress) that grabs the contents of a given URL on my Netlify site and embeds the HTML content into a section on my WordPress site. This has been working great in most cases. However, in one instance, I'm running into some styling issues with the WordPress stylesheet interfering with the embedded Vike component.
I decided to try placing the Vike component into a Shadow DOM. This resolved all my style collisions, but the problem I'm dealing with now appears to be some type of race condition. On some page loads, the component is loaded into the shadow DOM without any problems. Other times, I get the following error:
I'm guessing that in the process of moving elements into the shadow DOM, Vike can't find that script. I've been looking over the documentation to find if there is some type of hook that I could use to initialize my Vike component on my own, once the shadow DOM has been created. Is something like that possible? Or any other suggestions for this use case? Thanks in advance!
My vite config for reference:
Beta Was this translation helpful? Give feedback.
All reactions