Skip to content

Commit

Permalink
fix(web): improve Proxy check to avoid SSR problems (#2851)
Browse files Browse the repository at this point in the history

Co-authored-by: dwieeb <[email protected]>
  • Loading branch information
Florian Gyger and imhoffd authored May 21, 2020
1 parent 8736d90 commit 7afc9eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/web-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>(this.Plugins, {
Expand Down

0 comments on commit 7afc9eb

Please sign in to comment.