EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

NS7.0 Class constructor Observable cannot be invoked without 'new' #1657

Closed MitkoTschimev closed 3 years ago

MitkoTschimev commented 3 years ago

Firebase is not working for me with nativescript 7

I am using:

"@nativescript/angular": "10.0.0",
    "@nativescript/core": "7.0.0",
    "@nativescript/firebase": "^11.0.0-rc.0",
    "@nativescript/theme": "~2.5.0",
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught TypeError: Class constructor Observable cannot be invoked without 'new'
at
SharedNotificationDelegateCommon(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.common.js:7:0)
at SharedNotificationDelegateImpl(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.ios.js:23:0)
at ../node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.js(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.ios.js:181:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ../node_modules/@nativescript/firebase/messaging/messaging.js(file: node_modules/@nativescript/firebase/messaging/messaging.ios.js:4:50)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ../node_modules/@nativescript/firebase/firebase.js(file: node_modules/@nativescript/firebase/firebase.ios.js:8:24)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ./app/core/auth.service.ts(file: src/app/core/auth.service.ts:10:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ./app/app.component.ts(file: src/app/app.component.ts:2:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ./app/app.module.ts(file: src/app/app.module.ts:5:0<…>
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught TypeError: Class constructor Observable cannot be invoked without 'new'
at
SharedNotificationDelegateCommon(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.common.js:7:0)
at SharedNotificationDelegateImpl(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.ios.js:23:0)
at ../node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.js(file: node_modules/nativescript-shared-notification-delegate/shared-notification-delegate.ios.js:181:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ../node_modules/@nativescript/firebase/messaging/messaging.js(file: node_modules/@nativescript/firebase/messaging/messaging.ios.js:4:50)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ../node_modules/@nativescript/firebase/firebase.js(file: node_modules/@nativescript/firebase/firebase.ios.js:8:24)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ./app/core/auth.service.ts(file: src/app/core/auth.service.ts:10:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at ./app/app.component.ts(file: src/app/app.component.ts:2:0)
at __webpack_require__(file: src/webpack/bootstrap:74:0)
at .<…>
MitkoTschimev commented 3 years ago

Ok was able to fix this with an alias in the webpack config:

'nativescript-shared-notification-delegate': '@nativescript/shared-notification-delegate' -> firebase needs to use the new dependency

NathanWalker commented 3 years ago

You can always explicitly use latest rc 11.0.0-rc.5 which has that already resolved.

MitkoTschimev commented 3 years ago

Cool, where can I see what is the latest version?

image

via npm, I can't see it

NathanWalker commented 3 years ago

Under versions tab you’ll see it - we’re sorting out some global symbol adjustments before posting a final version but will publish a few other rc’s up until then and we’ll update the rc tag to reflect those this week.

MitkoTschimev commented 3 years ago

... :( thx didn't see it. Thanks for your hard work!