From 7e090cc6f218e0316d0a229e9f778158379bb120 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sun, 24 Feb 2019 00:16:45 -0600 Subject: [PATCH] fix(ssr): remove cordova warning during ssr --- src/@ionic-native/core/decorators/common.ts | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index 0c213f837..95641d51f 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -354,20 +354,22 @@ export function pluginWarn(pluginName: string, plugin?: string, method?: string) * @param method */ export function cordovaWarn(pluginName: string, method?: string): void { - if (method) { - console.warn( - 'Native: tried calling ' + - pluginName + - '.' + - method + - ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator' - ); - } else { - console.warn( - 'Native: tried accessing the ' + - pluginName + - ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator' - ); + if (typeof process === 'undefined') { + if (method) { + console.warn( + 'Native: tried calling ' + + pluginName + + '.' + + method + + ', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator' + ); + } else { + console.warn( + 'Native: tried accessing the ' + + pluginName + + ' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator' + ); + } } }