Ran into this frustrating scenario today while trying to debug my Redux store:

console.log(reducer)

debugger; const store = createStore(

reducer,

initialState,

compose(

applyMiddleware(thunk),

window.__REDUX_DEVTOOLS_EXTENSION__ &&

window.__REDUX_DEVTOOLS_EXTENSION__({

name: "app",instanceId: "app"

})

)

);

From the debugger statement, typing reducer into DevTools threw an uncaught ReferenceError, BUT it was still available for the log statement. I did some Googling, and found an explanation here. Basically, there’s a bit of optimization happening behind the scenes and Chrome does some extra clean up if the variables aren’t within a closed scope.

Simple (but ugly) fix if you really, really have to inspect those variables: