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

'toISOString is not a function' when using 'redux-devtools-extension' #347

Closed
kuncevic opened this issue Oct 24, 2017 · 4 comments
Closed

Comments

@kuncevic
Copy link

kuncevic commented Oct 24, 2017

Here is the thread ngrx/platform#61 with detailed issue.

Basically there is something is going on when using https://github.com/gaearon/redux-devtools chrome extension, the issue is taking place only when extension is enabled.

I debug the issue for some time and discovered that it is related to import 'core-js/es6/date'; polyfil.

Seems like that is the piece of code which is causing an error:

$export($export.P + $export.F * __webpack_require__("../../../../core-js/modules/_fails.js")(function(){
  return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
  toJSON: function toJSON(key){
    var O  = toObject(this)
      , pv = toPrimitive(O);
    return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  }
});

So if I comment the import 'core-js/es6/date'; in my polyfils.ts - all good, then I can use redux-devtools

Not sure if this one is related #326

@zloirock
Copy link
Owner

zloirock commented Oct 24, 2017

It's completely correct step by step implementation of Date.prototype.toJSON and it's not be polyfilled in modern engines. Could you add more info about your environment and provide a simple reproducible example? Your problem could be the same like in #326.

@kuncevic
Copy link
Author

kuncevic commented Oct 26, 2017

Could you add more info about your environment and provide a simple reproducible example?

@zloirock I will come back on that

@richinator38
Copy link

Using Angular 4.3 I could get this by lazy loading modules...it didn't occur before that change.

@zloirock
Copy link
Owner

Closed as can't reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants