zalmoxisus / mobx-remotedev

MobX DevTools extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: toISOString is not a function

Jonatthu opened this issue · comments

This is happening with the latest extensions of chrome 2.14.2
But this was working very good before two versions ago, How can I downgrade to other versions to see which one was working good?

That's not something introduced in the latest version of the extension. See for example zalmoxisus/redux-devtools-extension#315, which was happening in 2.14.0 as well.

This is happening because you're passing a React synthetic event directly to the action or a React component (which includes a synthetic event). A synthetic event is flushing the data (unless event.persist() is called).

The above exception happens because JSON.stringify is trying to call toISOString of a Date instance, which doesn't exists at the moment of serialization (being flushed by React).

Here are some solutions you can use. However, if you could share a repo to reproduce the issue, I'd try to find a way to overpass this exception from inside jsan.

You can try to install 2.13.1 by downloading and unzipping chrome.zip and then load the extension's folder.

I'm using the function this way too, is there a problem with this?
remotedev(this, {name: 'MAPWORDS STORE', global: true});
@zalmoxisus

It's not about the remotedev function, but about mobx actions and states being serialized. So, you have to make sure not to pass synthetic events anywhere, but only the needed part from them as described in Troubleshooting. If you could share a repro, I'd give more details.

@zalmoxisus with the decorator is failing, but the function on the constructor was working before
https://github.com/Jonatthu/angular-dependency-injection-failing/blob/master/src/app/store/store.ts#L18

The decorator is ok, but that previous approach is not something we'd support. You should pass the class (to be extended) not the instance to remotedev.

So, instead of the decorator it would be:

class Store {
//...
}
export default remotedev(Store)

Could you please provide steps to reproduce the issue with that repo?

I see you're not using React, so my assumption about Synthetic events is wrong.

angular/angular-cli#4994 (comment)

Can we do something about it?

Unfortunately, I don't know much about Angular and about how the providers and injections should work. I cloned the repo, ran ng serve and getting app works!. Not sure what I should look for.

In order to interact with the app (to change the data from the monitor side), we're extending the class here. This is the only thing that can interfere with that second decorator.

We are assuring not to do any operations when the extension is not enabled, so the class is not extended in that case.

@zalmoxisus
https://github.com/Jonatthu/angular-dependency-injection-failing/blob/master/src/app/store/store.ts#L15
This part of the code is not allowing the parameter "http" to be injected to the constructor, only when the extension is active