Skip to content

Commit 98679c9

Browse files
authored
fix(client): scripts loading out of order when added through head (#2970)
1 parent 2a34c6b commit 98679c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/client/app/composables/head.ts

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ function createHeadElement([tag, attrs, innerHTML]: HeadConfig) {
6161
if (innerHTML) {
6262
el.innerHTML = innerHTML
6363
}
64+
if (tag === 'script' && !attrs.async) {
65+
// async is true by default for dynamically created scripts
66+
;(el as HTMLScriptElement).async = false
67+
}
6468
return el
6569
}
6670

0 commit comments

Comments
 (0)