redux-devtools-extension
redux-devtools-extension copied to clipboard
Always "No store found"
The extension doesn't start.
I have an app with server side rendering. Following the instruction, I set up the plugin like this.
On server routes.js
const composeWithDevTools = require('redux-devtools-extension').composeWithDevTools;
let store = createStore(reducer, state, composeWithDevTools(applyMiddleware(thunkMiddleware, loggerMiddleware)));
let html = ReactDOMServer.renderToString(getApp(store, renderProps));
In browser's part:
let store = createStore(
reducers,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() && window.__state__,
applyMiddleware(thunkMiddleware, loggerMiddleware)
);
let Application = (
<Provider store={store}>
{ routes }
</Provider>
)
But I always get No store found
. What do I miss? How to make it work?
See the usage. So, you're applying the extension s
preloadedStateto
createStore`. It should be:
+ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
let store = createStore(
reducers,
window.__state__,
composeEnhancers(applyMiddleware(thunkMiddleware, loggerMiddleware))
);
As per server side, click Remote
button from the bottom.
@zalmoxisus I updated createStore to use above example, still have No store found
half of the time.
same error for me via chrome extension:
const middleware = applyMiddleware(
routerMiddleware(),
thunk,
apolloClient.middleware(),
)
const enhancers = [
middleware,
]
const composeEnhancers =
typeof window !== 'undefined' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose
const store = createStore(
combineReducers({
apollo: apolloClient.reducer(),
criteria,
searchInput,
listGallery,
router,
}),
initialState,
composeEnhancers(...enhancers)
)
happens intermittently but works 25% of the time
Is your issue related to #547?
I'm facing the same problem.
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
is always undefined
Version: 2.17.0 on Ubuntu Chrome
Tried these but doesn't help:
-
Turned on "Allow access to file URLs"
-
Click "Reload frame"