htmx
htmx copied to clipboard
Dom is parsed before the sse extension being loaded when using "defer"
I want to use the new sse extension but it doesn't work when using "defer" because the dom is "parsed" by htmx before the load of the extension.
I declare the script tags in my <head> like this:
<script src="https://unpkg.com/[email protected]" defer></script>
<script src="https://unpkg.com/[email protected]/dist/ext/sse.js" defer></script>
This way a tag with hx-ext="sse" already in place in the dom won't be handled by the extension because the sse extension is loaded after the initial "parse", and the extension doesn't do a new "parse".
PS: when not using defer, it works as expected
@twidi Had the same issue, did you find a workaround?