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

TypeError: toISOString is not a function #598

Closed
artem-v-shamsutdinov opened this issue Nov 29, 2018 · 6 comments
Closed

TypeError: toISOString is not a function #598

artem-v-shamsutdinov opened this issue Nov 29, 2018 · 6 comments

Comments

@artem-v-shamsutdinov
Copy link

Hello,

I'm assuming this is related to:

#315

However, it works (on Windows 7) with:
Version 70.0.3538.67 (Official Build) (64-bit)
Devtools 2.15.5

And is broken (on Windows 10) with:
Version 70.0.3538.102 (Official Build) (64-bit)
Devtools 2.16.4

I'm not sure exactly when it broke but I assume very recently - just got first report this morning.

Details:

core.js:1449 ERROR Error: Uncaught (in promise): TypeError: toISOString is not a function
TypeError: toISOString is not a function
at String.toJSON ()
at Object.eval (_ctx.js:18)
at derez (:1:67530)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:67969)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:68151)
at String.toJSON ()
at Object.eval (_ctx.js:18)
at derez (:1:67530)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:67969)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:68151)
at resolvePromise (zone.js:814)
at resolvePromise (zone.js:771)
at eval (zone.js:873)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4751)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:595)
at ZoneTask.invokeTask [as invoke] (zone.js:500)
at invokeTask (zone.js:1540)

Action:

{
action: {
payload: {
event: {
id: 49843783
state: RouterStateSnapshot {_root: TreeNode, url: "/foo-bar/foo-bar-bar"}
url: "/foo-bar/foo-bar-bar"
urlAfterRedirects: "/foo-bar/foo-bar-bar"
},
routerState: {
root: // getter
url: "/foo-bar/foo-bar-bar"
_root: // additional data with circular dependencies
}
},
type: "ROUTER_NAVIGATION"
}
timestamp: undefined
type: "PERFORM_ACTION"
}

The action cannot be serialized via general methods:

VM22530:1 Uncaught TypeError: Converting circular structure to JSON
at JSON.stringify ()
at eval (eval at (_ctx.js:20), :1:6)
at Object.eval (_ctx.js:18)
at derez (:1:67530)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:68151)
at derez (:1:67969)
at derez (:1:68151)
at derez (:1:68151)

Any help would be greatly appreciated.

Thanks, :)

@zalmoxisus
Copy link
Owner

zalmoxisus commented Nov 29, 2018

We downgraded jsan to 3.1.9 in recent versions as per kolodny/jsan#24. It excludes only kolodny/jsan#20. Do you think that could solve this issue? You can try to install both versions of jsan and try jsan.stringify(obj, null, null, true) inside of your application with that object to see if it can be serialized.

I think it works on other machine not because Windows version is different, but because our extension was not autoupdated there.

UPDATE: I see that PR doesn't affect stringify, only parse, but still better to check if you can get it work directly.

@artem-v-shamsutdinov
Copy link
Author

Yep,

That was it. Serialization of that action works correctly with jsan 3.1.10 and 3.1.11. It breaks with jsan 3.1.9.

I'm also posting the jsan issue #24

Thank you! :)

@zalmoxisus
Copy link
Owner

I guess this commit is solving this issue, but there's the other mentioned above causing another issue.

@artem-v-shamsutdinov
Copy link
Author

artem-v-shamsutdinov commented Nov 30, 2018

Understood, thank you for looking into it! Unfortunately we do not presently have the resources needed to research the issue further and contribute the necessary fix.

If it helps, we are using:

@angular 5.2.11
@ngrx 5.2.0
ngrx-data@1.0.0-beta.13

The action that is causing the issue is 3-rd party to us. It is the "ROUTER_NAVIGATION" action from @ngrx

Thanks, :)

@zalmoxisus
Copy link
Owner

zalmoxisus commented Nov 30, 2018

As a temporal workaround, you can sanitize that part.
There's an example for ui-router in #455 (comment).

UPDATE: Sorry, just noticed you are using ngrx, sanitizing doesn't work with it as the lifted state is passed directly from there.

@zalmoxisus
Copy link
Owner

It's fixed in 2.16.5 which is available on Chrome Store.

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

No branches or pull requests

2 participants