Skip to content

Commit 4ef03eb

Browse files
authored
fix(vue): guard s._statusRef (#642)
1 parent d2f8645 commit 4ef03eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/vue/src/scripts/useScript.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export function useScript<T extends Record<symbol | string, any> = Record<symbol
104104
// @ts-expect-error untyped
105105
head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook('script:updated', ({ script: s }) => {
106106
// @ts-expect-error untyped
107-
s._statusRef.value = s.status
107+
if (s._statusRef) {
108+
// @ts-expect-error untyped
109+
s._statusRef.value = s.status
110+
}
108111
})
109112
// @ts-expect-error untyped
110113
const script = _useScript(head, input as BaseUseScriptInput, options)

0 commit comments

Comments
 (0)