2
votes

I am attempting to login using cordova plugins with Google Plus and Facebook. Both of these npm packages are giving me the issue:

core.js:1598 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at index.js:245 at Object../node_modules/@ionic-native/facebook/index.js (index.js:313) at webpack_require (bootstrap:81) at Object../src/app/services/auth.service.ts (chunk-fe7f197d.js:144) at webpack_require (bootstrap:81) at Object../src/app/pages/login/login.page.ts (pages-login-login-module.js:115) at webpack_require (bootstrap:81) at Object../src/app/pages/login/login.module.ts (pages-login-login-module.js:21) at webpack_require (bootstrap:81) at $_lazy_route_resource lazy namespace object:37 at index.js:245 at Object../node_modules/@ionic-native/facebook/index.js (index.js:313) at webpack_require (bootstrap:81) at Object../src/app/services/auth.service.ts (chunk-fe7f197d.js:144) at webpack_require (bootstrap:81) at Object../src/app/pages/login/login.page.ts (pages-login-login-module.js:115) at webpack_require (bootstrap:81) at Object../src/app/pages/login/login.module.ts (pages-login-login-module.js:21) at webpack_require (bootstrap:81) at $_lazy_route_resource lazy namespace object:37 at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:4053) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)

My Info is:

@ionic/cli-utils : 2.0.0-rc.6 ionic (Ionic CLI) : 4.0.0-rc.6

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@angular-devkit/core : 0.6.0 @angular-devkit/schematics : 0.6.0 @angular/cli : 6.0.1 @ionic/schematics-angular : 1.0.0-rc.6 Cordova Platforms : none Ionic Framework : @ionic/angular 4.0.0-alpha.7

System:

Android SDK Tools : 26.1.1 NodeJS : v8.9.4 npm : 6.1.0 OS : Windows 10

Environment Variables:

ANDROID_HOME : D:\SumTech Solutions\Software\Android_SDK

This becomes an issue only when i add the Imports to the constructor in my auth.service.

1
What @ionic-native/facebook version have you installed? Make sure to use the latest v5 beta. However, I'm having the same issue with a custom written plugin. - timbru31

1 Answers

0
votes

I was also facing similar problems with other native plugins, i got a solution from here, this may help you.

Update your native libs to 5.0.0-beta.14, each of them inclusive @ionic-native/core

"@ionic-native/splash-screen": "5.0.0-beta.14",  
"@ionic-native/status-bar": "5.0.0-beta.14",

While using in app use

import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';