From af0135ce7dbe737b2df46094fd3dc8a41bdb60ae Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 19 Jan 2022 16:03:53 -0500 Subject: [PATCH] fix(col): col no longer errors when running in non-browser environment (#24603) resolves #24446 Co-authored-by: Sean Perkins --- core/src/components/col/col.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/components/col/col.tsx b/core/src/components/col/col.tsx index e36f6207f1..932952659b 100644 --- a/core/src/components/col/col.tsx +++ b/core/src/components/col/col.tsx @@ -3,8 +3,8 @@ import { Component, ComponentInterface, Host, Listen, Prop, forceUpdate, h } fro import { getIonMode } from '../../global/ionic-global'; import { matchBreakpoint } from '../../utils/media'; -const win = window as any; -const SUPPORTS_VARS = !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0')); +const win = (typeof (window as any) !== 'undefined') ? window as any : undefined; +const SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0')); const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl']; @Component({