We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3e277db + 0f69032 commit f8f1c2fCopy full SHA for f8f1c2f
src/index.ts
@@ -16,7 +16,7 @@ Promise._immediateFn = setAsap;
16
17
// side effects
18
Promise.resolve().then(() => {
19
- if (!window.VGSCollect) {
+ if (typeof window !== 'undefined' && !window.VGSCollect) {
20
// DNS lookup
21
preFetch();
22
// Establish connection to the server
@@ -38,7 +38,7 @@ const loadVGSCollect = (config: IConfig = isRequired('config')) => {
38
registerScriptLoading({ vaultId, environment, version });
39
40
return new Promise((resolve, reject) => {
41
- if (typeof window === undefined) {
+ if (typeof window === 'undefined') {
42
reject(ERROR_MESSAGE.IS_UNDEFINED('window'));
43
return;
44
}
0 commit comments