From 98679c9e82fcd3bbe3829640d0386cbd730e61ba Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 15 Sep 2023 19:07:01 +0530 Subject: [PATCH] fix(client): scripts loading out of order when added through head (#2970) --- src/client/app/composables/head.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/app/composables/head.ts b/src/client/app/composables/head.ts index d52d3986..ee8fd602 100644 --- a/src/client/app/composables/head.ts +++ b/src/client/app/composables/head.ts @@ -61,6 +61,10 @@ function createHeadElement([tag, attrs, innerHTML]: HeadConfig) { if (innerHTML) { el.innerHTML = innerHTML } + if (tag === 'script' && !attrs.async) { + // async is true by default for dynamically created scripts + ;(el as HTMLScriptElement).async = false + } return el }