From 9aeeb4fa31396040b6014af2b45111a05751547d Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:37:41 +0530 Subject: [PATCH] fix(theme): use a getter as VPSidebar's open watch source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `watch([props, navEl], ...)` is only accidentally valid on the client, where props reaching setup are shallow-reactive. During SSR props are not reactified (dev mode additionally wraps them in shallowReadonly), so dev-flavored SSR warns "Invalid watch source: Proxy({ open: false })" once per rendered page. Normally invisible because build() forces NODE_ENV=production before vue loads — but any process that already required vue under a different NODE_ENV (programmatic builds inside test runners) keeps dev vue in the module cache and surfaces it. Repro (pure Vue, no vitepress): renderToString of a component doing watch([props, ref], cb, { immediate: true, flush: 'post' }) under dev vue. Watching `() => props.open` expresses the actual dependency and is valid in both environments. --- src/client/theme-default/components/VPSidebar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/theme-default/components/VPSidebar.vue b/src/client/theme-default/components/VPSidebar.vue index b3105f8c2314..594f78d1aee6 100644 --- a/src/client/theme-default/components/VPSidebar.vue +++ b/src/client/theme-default/components/VPSidebar.vue @@ -15,7 +15,7 @@ const navEl = ref(null) const isLocked = useBodyScrollLock() watch( - [props, navEl], + [() => props.open, navEl], () => { if (props.open) { isLocked.value = true