redux-devtools-extension icon indicating copy to clipboard operation
redux-devtools-extension copied to clipboard

Always "No store found"

Open wzup opened this issue 7 years ago • 5 comments

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?

chrome reduxdevtools no store found - google chrome 2017-02-12 09 08 25

wzup avatar Feb 12 '17 01:02 wzup

See the usage. So, you're applying the extension s preloadedStatetocreateStore`. 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 avatar Feb 12 '17 08:02 zalmoxisus

@zalmoxisus I updated createStore to use above example, still have No store found half of the time.

alozytskyi avatar Apr 26 '17 08:04 alozytskyi

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

lfender6445 avatar Sep 06 '17 23:09 lfender6445

Is your issue related to #547?

Sawtaytoes avatar Oct 26 '18 19:10 Sawtaytoes

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:

  1. Turned on "Allow access to file URLs" image

  2. Click "Reload frame" image

terrynguyen255 avatar Oct 06 '20 10:10 terrynguyen255