From 5ecd2271ca86087cb805548397d75c38763ad412 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 11 Mar 2025 10:36:13 +0100 Subject: [PATCH] fix(vue): prevent calling `useHead` in colors --- src/runtime/plugins/colors.ts | 4 +++- src/runtime/vue/stubs.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/plugins/colors.ts b/src/runtime/plugins/colors.ts index 31bc5926..3a37daaa 100644 --- a/src/runtime/plugins/colors.ts +++ b/src/runtime/plugins/colors.ts @@ -55,5 +55,7 @@ export default defineNuxtPlugin(() => { }] } - useHead(headData) + if (!nuxtApp.isVue) { + useHead(headData) + } }) diff --git a/src/runtime/vue/stubs.ts b/src/runtime/vue/stubs.ts index e739dd1b..4bc64120 100644 --- a/src/runtime/vue/stubs.ts +++ b/src/runtime/vue/stubs.ts @@ -61,6 +61,7 @@ export const useState = (key: string, init: () => T): Ref => { export function useNuxtApp() { return { isHydrating: true, + isVue: true, payload: { serverRendered: false } } }