Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Error when middleware included with redux-immutable-state-invariant #29

Open
nkdevirl opened this issue Oct 9, 2017 · 1 comment
Open

Comments

@nkdevirl
Copy link

nkdevirl commented Oct 9, 2017

I'm new to front end development, so hopefully I'm not wasting anyones time with this.

When I add the following to my createStore and add middleware like below

import {createStore, applyMiddleware} from 'redux';
import rootReducer from '../reducers';
import reduxImmutableStateInvariant from 'redux-immutable-state-invariant';
import thunk from 'redux-thunk';

export default function configureStore(initialState) {

  return createStore(
    rootReducer,
    initialState,
    applyMiddleware(thunk, reduxImmutableStateInvariant())
  );
}

It causes the following error

Invariant Violation: A state mutation was detected between dispatches, in the path cognito.user.pool.client.api.operations.addCustomAttributes.input.defaultValue. This may cause incorrect behavior. (http://redux.js.org/docs/Troubleshooting.html#never-mutate-reducer-arguments)

Is this something I can ignore? the error disappears when I change applyMiddleware to

applyMiddleware(thunk)

@HoraceShmorace
Copy link

This is a duplicate of the issue I posted: #28. react-cognito definitely doesn't work when your store uses applyMiddleware.

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

No branches or pull requests

2 participants