Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

SetValue of type Date Error on iOS #1884

Open
danouche93 opened this issue Jul 25, 2022 · 0 comments
Open

SetValue of type Date Error on iOS #1884

danouche93 opened this issue Jul 25, 2022 · 0 comments

Comments

@danouche93
Copy link

When I want to save an object with a property of type Date, NativeScript throw me an error

CONSOLE LOG: Error in firebase.setValue: Error: (setValue:withCompletionBlock:) Cannot store object of type __NSTaggedDate at 0.date. Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray.
CONSOLE ERROR: ERROR Error: Uncaught (in promise): Error: (setValue:withCompletionBlock:) Cannot store object of type __NSTaggedDate at 0.date. Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray.
Error: (setValue:withCompletionBlock:) Cannot store object of type __NSTaggedDate at 0.date. Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray.
at file: src/webpack:/TinaAppV2/node_modules/@nativescript/firebase/firebase.ios.js:1239:0
at new ZoneAwarePromise (file: src/webpack:/TinaAppV2/node_modules/zone.js/fesm2015/zone.js:1427:0)
at Object._firebase_common__WEBPACK_IMPORTED_MODULE_0__.firebase.setValue (file: src/webpack:/TinaAppV2/node_modules/@nativescript/firebase/firebase.ios.js:1237:0)
at FirebaseService.Set (file: src/webpack:/TinaAppV2/src/app/services/firebase.service.ts:36:8)
at Object.next (file: src/webpack:/TinaAppV2/src/app/home/preferences/preferences.component.ts:161:0)
at ConsumerObserver.exports.modules../node_modules/rxjs/dist/cjs/internal/Subscriber.js.ConsumerObserver.next (file: src/webpack:/TinaAppV2/node_modules/rxjs/dist/cjs/internal/Subscriber.js:113:0)
at SafeSubscriber.exports.modules../node_modules/rxjs/dist/cjs/internal/Subscriber.js.Subscriber._next (file: src/webpack:/TinaAppV2/node_modules/rxjs/dist/cjs/internal/Subscriber.js:80:0)
at SafeSub<\M-b\M^@\M-&>
nothing happened to generator for 5 sec, auto-deactivating it with activationCount: 0; <UISelectionFeedbackGenerator: 0x280a3a300>

Is that a normal behavior ? I don't have that problem with android. I use NativeScript with angular

my package.json

{
  "name": "TinaAppV2",
  "main": "./src/main.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/forms": "~13.2.0",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "@nativescript/angular": "^13.0.0",
    "@nativescript/core": "~8.2.2",
    "@nativescript/datetimepicker": "^2.1.10",
    "@nativescript/firebase": "^11.1.2",
    "@nativescript/geolocation": "^8.0.2",
    "@nativescript/theme": "~3.0.2",
    "@nstudio/nativescript-checkbox": "^2.0.5",
    "@nstudio/nativescript-floatingactionbutton": "^3.0.4",
    "@nstudio/nativescript-pulltorefresh": "^3.0.2",
    "nativescript-forgm-sound": "^1.1.3",
    "nativescript-ui-chart": "^9.0.2",
    "nativescript-ui-listview": "^10.1.1",
    "nativescript-ui-sidedrawer": "^10.0.2",
    "rxjs": "~7.5.0",
    "zone.js": "~0.11.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.3.6",
    "@angular/compiler-cli": "~13.2.0",
    "@nativescript/android": "8.2.2",
    "@nativescript/ios": "8.2.3",
    "@nativescript/types": "~8.2.0",
    "@nativescript/webpack": "~5.0.6",
    "@ngtools/webpack": "~13.2.0",
    "typescript": "~4.5.5"
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant