From c52f95ca4244fd5f33105d57bb580b7fcf17c68e Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Wed, 20 Nov 2024 11:42:05 -0800 Subject: [PATCH] fix cdn check for node --- pxtlib/emitter/cloud.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxtlib/emitter/cloud.ts b/pxtlib/emitter/cloud.ts index 24f6058be95..18e3b05351f 100644 --- a/pxtlib/emitter/cloud.ts +++ b/pxtlib/emitter/cloud.ts @@ -32,7 +32,7 @@ namespace pxt.Cloud { export function useCdnApi() { return pxt.webConfig && !pxt.webConfig.isStatic && !BrowserUtils.isLocalHost() && !!pxt.webConfig.cdnUrl - && !/nocdn=1/i.test(window.location.href); + && (typeof window === "undefined" || !/nocdn=1/i.test(window.location.href)); } export function cdnApiUrl(url: string) {