]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: prevent resolveCssVars from being called before component is mounted
authordaiwei <daiwei521@126.com>
Thu, 13 Nov 2025 08:35:05 +0000 (16:35 +0800)
committerdaiwei <daiwei521@126.com>
Thu, 13 Nov 2025 08:35:05 +0000 (16:35 +0800)
packages/runtime-vapor/src/dom/prop.ts

index 4b067fa2406befea17e2adb0975ce90cdbc67a94..eb0585af29ac16bef67fe6f1d5fee5abf98b2c30 100644 (file)
@@ -638,12 +638,7 @@ function resolveCssVars(
   block: Block,
   expectedMap: Map<string, string>,
 ): void {
-  if (__DEV__ && !instance.isMounted) {
-    throw new Error(
-      'resolveCssVars should NOT be called before component is mounted',
-    )
-  }
-
+  if (!instance.isMounted) return
   const rootBlocks = normalizeBlock(instance)
   if (
     (instance as GenericComponentInstance).getCssVars &&