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

firstRoute is not a serializable Action #77

Open
pjnovas opened this issue Apr 28, 2020 · 1 comment
Open

firstRoute is not a serializable Action #77

pjnovas opened this issue Apr 28, 2020 · 1 comment

Comments

@pjnovas
Copy link

pjnovas commented Apr 28, 2020

I'm getting an error from redux as soon as I dispatch firstRoute Action, I guess it's because commit inside it is a function/ promise to render react after it.

index.js:1 A non-serializable value was detected in an action, in the path: `commit`. Value: ƒ (action) {
        if (committed) return Promise.resolve();
        committed = true;
        return Promise.resolve(commit(action)).then(function () {
          if (!_this8.options.save) return;

  … 
Take a look at the logic that dispatched this action:  {type: "HOME", params: {…}, query: {…}, hash: "", state: {…}, …} 

It tells me to see: https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants

Is there a workaround? or another way of lifting the router without dispatching a non serializable action?

After that everything seems to work fine.
Thanks!

@pjnovas
Copy link
Author

pjnovas commented Apr 28, 2020

I've found a workaround for this error which I describe below for anyone else, but firstRouter() should be a serializable action, right?

If you are using redux-starter-kit, you can turn off this error by setting
serializableCheck to false as option for getDefaultMiddleware.

More info

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

1 participant