Skip to content

Commit af0135c

Browse files
fix(col): col no longer errors when running in non-browser environment (#24603)
resolves #24446 Co-authored-by: Sean Perkins <sean@ionic.io>
1 parent 360643d commit af0135c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/components/col/col.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Component, ComponentInterface, Host, Listen, Prop, forceUpdate, h } fro
33
import { getIonMode } from '../../global/ionic-global';
44
import { matchBreakpoint } from '../../utils/media';
55

6-
const win = window as any;
7-
const SUPPORTS_VARS = !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));
6+
const win = (typeof (window as any) !== 'undefined') ? window as any : undefined;
7+
const SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));
88
const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];
99

1010
@Component({

0 commit comments

Comments
 (0)