ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.06k stars 13.51k forks source link

RC 5: toISOString is not a function #9996

Closed rhday74 closed 7 years ago

rhday74 commented 7 years ago

Ionic version: (check one with "x") [x] 2.x

I'm submitting a ... (check one with "x") [x] bug report

Current behavior: using ionic:serve with RC 5 I get the following error at runtime:

TypeError: toISOString is not a function
    at String.toJSON (<anonymous>)
    at Object.<anonymous> (http://localhost:8100/build/polyfills.js:1:3520)
    at t (<anonymous>:1:31412)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)
    at t (<anonymous>:1:32025)

Related code:

current package.json is as follows:

"dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.7",
    "immutable": "3.8.1",
    "ionic-angular": "2.0.0-rc.5",
    "ionic-native": "2.2.11",
    "ionicons": "3.0.0",
    "lodash": "4.17.4",
    "moment": "2.17.1",
    "ng2-redux": "5.1.0",
    "ng2-translate": "5.0.0",
    "redux": "3.6.0",
    "redux-localstorage": "0.4.1",
    "redux-logger": "2.7.4",
    "redux-observable": "0.12.2",
    "rxjs": "5.0.0-beta.12",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.0.0",
    "codelyzer": "2.0.0-beta.4",
    "stylelint": "7.7.1",
    "stylelint-declaration-use-variable": "1.6.0",
    "tslint": "4.3.1",
    "tslint-eslint-rules": "3.2.3",
    "typescript": "2.0.9"
  },

Other information: got the latest Ionic CLI installed globally. Pretty sure I nailed the dependency versions. Only other thing I have that isn't stock is I've moved the location of the main.ts file and modified sourcemaps:

"config": {
    "ionic_source_map_type": "eval-source-map",
    "ionic_app_entry_point": "src/main.ts"
  },

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
ios-deploy version: 1.9.0 
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Xcode 8.2.1 Build version 8C1002

Error Stacktrace:

ErrorHandler.handleError @ VM1204:53
IonicErrorHandler.handleError @ VM1658:58
next @ VM1203:298
schedulerFn @ VM1229:89
SafeSubscriber.__tryOrUnsub @ VM1234:223
SafeSubscriber.next @ VM1234:172
Subscriber._next @ VM1234:125
Subscriber.next @ VM1234:89
Subject.next @ VM1230:55
EventEmitter.emit @ VM1229:81
NgZone.triggerError @ VM1228:280
onHandleError @ VM1228:259
t.handleError @ polyfills.js:3
e.runTask @ polyfills.js:3
invoke @ polyfills.js:3
mhartington commented 7 years ago

How could I recreate this? Are you calling any custom code?

Could you push a small demo with a similar setup to github?

rhday74 commented 7 years ago

tell you what I'll do. I'll start adding in the extra stuff that I'm using like redux, immutable-js, ng2-translate to the tabs starter project (that's what I built my app off of) until it breaks. Probably the easiest way to track down the culprit without throwing all my app code at you. I'll try and get to it the next couple of days.

I did some tweaking to the tabs starter project with RC 5 and couldn't break it so it's gotta be one of those extra dependencies I'm using that's being a jerk >.<

wbhob commented 7 years ago

just search toISOString() in your project. It is a moment function, so it's either something you wrote, or it could be the datepicker component.

rhday74 commented 7 years ago

that was my initial thought but unfortunately I'm not using moment in the app yet :/ there's no imports of it anywhere, not yet at least. Not mucking with any Ionic DateTime stuff yet either.

jgw96 commented 7 years ago

Hello all! Because this cannot be reproduced tabs starter and it seems to be an error in one of the deps of @rhday74 's app I am going to close this one for now. If it does end up being an Ionic issue feel free to comment and we will happily reopen. Thanks!

rhday74 commented 7 years ago

sorry, real life happened....consulting gig I'm on exploded so been glued to the macbook billing hours. I'll revisit this when I come up for air and figure out what deps exactly is a problem.

emcniece commented 6 years ago

Possibly related to https://github.com/ngrx/platform/issues/61

emcniece commented 6 years ago

Figured out that this error (for me, anyway) was due to a store property that couldn't be serialized, possibly due to circular references. I didn't have luck with creating a custom serializer - I ended up refactoring code to make this object available in a provider instead of a store.

ionitron-bot[bot] commented 6 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.