Skip to content

Target container is not a DOM element. #290

Answered by ElMassimo
jpriollaud asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there!

Is vite_ruby acceleration logic

Not sure what you are referring to 😃


By default all scripts in Vite are type=module, which by are defer by default.

Scripts with the defer attribute will execute in the order in which they appear in the document.

...the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded.

If an HTML element is defined (and closed) before a script element, it will always be available when the script is executed (in fact that's exactly the technique I'm using to hydrate islands in îles).

The issue you are experiencing suggests malformed HTML, or that the script is inside the root element.


If you share a repo …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@jpriollaud
Comment options

@ElMassimo
Comment options

Answer selected by jpriollaud
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants