diff --git a/pxtlib/emitter/cloud.ts b/pxtlib/emitter/cloud.ts index 24f6058be95a..18e3b05351f5 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) {