reduxjs / redux-devtools

DevTools for Redux with hot reloading, action replay, and customizable UI
http://youtube.com/watch?v=xsSnOQynTHs
MIT License
13.96k stars 1.15k forks source link

Redux DevTools crashes after I start changing redux state. #1339

Open ezlo-lesiam opened 1 year ago

ezlo-lesiam commented 1 year ago

The application has loaded and the state is in Redux image

Moved the element and then Redux DevTools crashed image

My Redux DevTools connection code

import { createStore, applyMiddleware, compose } from 'redux';

import reducer from 'src/redux/reducer';
import { sideEffects } from 'src/redux/middleware';

const enhancers = [];

export const configureStore = () => {
    const devToolsExtension = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
    if (typeof devToolsExtension === 'function') {
        enhancers.push(devToolsExtension());
    }
    const composedEnhancers = compose(applyMiddleware(sideEffects), ...enhancers);

    return createStore(reducer, composedEnhancers);
};

My Middleware:

import { STORE_RAPPID } from 'src/redux/helpers/actionTypes';
import { SharedEvents } from 'src/rappid/controller';
import { importGraphFromJSON } from 'src/rappid/actions';
import { onGraphStartBatch, onGraphStopBatch } from 'src/rappid/controllers';

export const sideEffects = ({ getState }: { getState: Function }) => {
    return (next: Function) => (action: { type: string, payload: any }) => {
        if (action.type === STORE_RAPPID) {
            return next(action);
        }
        const { rappid } = getState();
        if (rappid) {
            switch (action.type) {
                case SharedEvents.JSON_EDITOR_CHANGED:
                    const json = action.payload;
                    importGraphFromJSON(rappid, json);
                    break;
                case SharedEvents.GRAPH_START_BATCH:
                    onGraphStartBatch(rappid, action.payload);
                    break;
                case SharedEvents.GRAPH_STOP_BATCH:
                    onGraphStopBatch(rappid, action.payload);
            }
        }
        return next(action);
    };
};

After Redux DevTools crashes, my application works fine and Redux keeps all the changes. Help please.

janaratolonbaeva commented 1 year ago

hi @ezlo-lesiam Did you solve the problem? I have the same one too