From 7afc9eb81ad622282a27b6dd3fca30165bf2af95 Mon Sep 17 00:00:00 2001 From: Florian Gyger Date: Thu, 21 May 2020 13:09:20 +0200 Subject: [PATCH] fix(web): improve Proxy check to avoid SSR problems (#2851) Co-authored-by: dwieeb --- core/src/web-runtime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/web-runtime.ts b/core/src/web-runtime.ts index 7c6776762..ee4edc874 100644 --- a/core/src/web-runtime.ts +++ b/core/src/web-runtime.ts @@ -13,7 +13,7 @@ export class CapacitorWeb { // Gracefully degrade in non-Proxy supporting engines, e.g. IE11. This // effectively means that trying to access an unavailable plugin will // locally throw, but this is still better than throwing a syntax error. - if ('Proxy' in window) { + if (typeof Proxy !== 'undefined') { // Build a proxy for the Plugins object that returns the "Noop Plugin" // if a plugin isn't available this.Plugins = new Proxy(this.Plugins, {