Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC 5: toISOString is not a function #9996

Closed
rhday74 opened this issue Jan 12, 2017 · 9 comments
Closed

RC 5: toISOString is not a function #9996

rhday74 opened this issue Jan 12, 2017 · 9 comments
Labels
needs: reply the issue needs a response from the user

Comments

@rhday74
Copy link

rhday74 commented Jan 12, 2017

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
Copy link
Contributor

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

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

@mhartington mhartington added v2 needs: reply the issue needs a response from the user labels Jan 12, 2017
@rhday74
Copy link
Author

rhday74 commented Jan 12, 2017

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
Copy link

wbhob commented Jan 12, 2017

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
Copy link
Author

rhday74 commented Jan 12, 2017

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
Copy link
Contributor

jgw96 commented Jan 20, 2017

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!

@jgw96 jgw96 closed this as completed Jan 20, 2017
@rhday74
Copy link
Author

rhday74 commented Jan 20, 2017

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
Copy link

Possibly related to ngrx/platform#61

@emcniece
Copy link

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
Copy link

ionitron-bot bot commented Sep 1, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

No branches or pull requests

5 participants