diff --git a/packages/runtime-dom/src/nodeOps.ts b/packages/runtime-dom/src/nodeOps.ts index 1fbcf483420..8ed70c7d330 100644 --- a/packages/runtime-dom/src/nodeOps.ts +++ b/packages/runtime-dom/src/nodeOps.ts @@ -9,7 +9,10 @@ import type { let policy: Pick | undefined = undefined -const tt = (window as unknown as TrustedTypesWindow).trustedTypes +const tt = + typeof window !== 'undefined' && + (window as unknown as TrustedTypesWindow).trustedTypes + if (tt) { try { policy = /*#__PURE__*/ tt.createPolicy('vue', {