question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After initial load every action seems to crash DevTools

See original GitHub issue

I’m loading the devtools like this:

const store = createStore(reducers,
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
  applyMiddleware(ReduxPromise, ReduxThunk));

ReactDOM.render(
  <Provider store={store}>
    <App />
  </Provider>, document.getElementById('root'));

Reducer:

export default function(state = INITIAL_STATE, action = {}) {
  switch(action.type) {
  case POPULATE_TABLE:
    return { ...state, rows: action.payload.data };
  case 'UPDATE_PAGE':
    return { ...state, page: action.payload };
  default:
    return state;
  }
}

Actions

export function fetchRows(page = 1) {
  const url = `${rootUrl}/records`;
  const request = axios.get(url);
  return function(dispatch) {
    dispatch(updatePage(page));
    return request.then((data) => {
      dispatch({
        type: POPULATE_TABLE,
        payload: data
      });
    }, (error) => {
      console.error(error);
    });
  };
}

export function updatePage(page) {
  return {
    type: 'UPDATE_PAGE',
    payload: page
  };
}

Using Chrome 65, High Sierra, React 16.3, Redux 3.7

Any help appreciated!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
miachenmtlcommented, May 4, 2018

I’m experiencing the same problem, but I think I see something wrong with your createStore call. I believe instead of

const store = createStore(reducers,
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
  applyMiddleware(ReduxPromise, ReduxThunk));

it should be

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducers, composeEnhancers(
  applyMiddleware(ReduxPromise, ReduxThunk)));

My configuration is this, though, and I don’t see what’s wrong with it:

const configureStore = (middleware) => {
  const store = createStore(
    reducer,
    composeWithDevTools(applyMiddleware(middleware))
  );
  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('./src/store/reducer', () => {
      const nextRootReducer = require('./src/store/reducer').default; // eslint-disable-line global-require
      store.replaceReducer(nextRootReducer);
    });
  }
  return store;
};

const sagaMiddleware = createSagaMiddleware();

const store = configureStore(sagaMiddleware);

This seems to be only a problem with Chromium. In Firefox it works okay.

0reactions
zalmoxisuscommented, Jan 3, 2019

@RossKinsella I published a build, which removes some recent changes, in #619. Let’s move the discussion there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips on solving 'DevTools was disconnected from the page ...
I was facing this problem on Google Chrome where DevTools was crashing every time on the same spot. On Chrome Canary the debugger...
Read more >
441223 - Dev Tool crashes on each site with a Ohn Snap ...
I have the same issue - chrome://crashes doesn't show any crash reporting though. It happens constantly, debugging websites is now impossible.
Read more >
Issues: Find and fix problems - Chrome Developers
Open DevTools. Click the Open Issues button next to Settings. Settings in the right corner of the action bar at the top. Depending...
Read more >
Redux DevTools: Tips and tricks for faster debugging
It is very hard to predict or catch all possible bugs in our apps. We encounter a number of issues after our applications...
Read more >
How to Effectively Inspect Network Activity in Chrome Dev Tools
We agreed on a debugging process after a brief conversation, but my initial suggestion relied too heavily on console.log() s, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found