NgRx Redux devtools not showing store and state details even though applicaton is working fine
Asked Answered
O

6

19

I am using the below sample application to learn angular+ngrx. APM Sample NgRx App

I have installed Redux firefox extension. But whenever I run/reload application, redux tab shows 'No store found' message. The application is working as expected(is able to retain state). I am able to dispatch actions, handle it in the reducer etc.. Please help.. I am stuck in this for quite a long time.

Olenolin answered 2/10, 2018 at 19:24 Comment(1)
Both chrome and firefox extensions show 'pin: undefined' on launching the redux devtoolsOlenolin
S
24

To use the Redux devtools you'll have to install @ngrx/store-devtools and import it in the AppModule - docs.

Install it with:

npm install @ngrx/store-devtools --save 

Import it with:

@NgModule({
  imports: [
    StoreModule.forRoot(reducers),
    // Instrumentation must be imported after importing StoreModule (config is optional)
    StoreDevtoolsModule.instrument({
      maxAge: 25, // Retains last 25 states
      logOnly: environment.production, // Restrict extension to log-only mode
    }),
  ],
})
export class AppModule {}
Shimmery answered 2/10, 2018 at 20:25 Comment(1)
It's important to note that the order of the imports is important. StoreDevtoolsModule must be loaded after StoreModule.Hyoscyamus
B
40

There is an issue with Angular app when Redux doesn't see your Store

Check that you have

StoreDevtoolsModule.instrument({maxAge: 25, logOnly: environment.production})

after

StoreModule.forRoot(reducers)

Otherwise you are in trouble.

BTW, it is better to install DevTools with

ng add @ngrx/store-devtools

It adds schematics to the project.

Bantamweight answered 2/2, 2020 at 0:20 Comment(2)
Thank you a lot. I just put the store dev tool above the StoreModule.forRoot. Silly meWallsend
@TonyNgo my problem also was the order of the store module and store devtools module , your comment helped meArlindaarline
S
24

To use the Redux devtools you'll have to install @ngrx/store-devtools and import it in the AppModule - docs.

Install it with:

npm install @ngrx/store-devtools --save 

Import it with:

@NgModule({
  imports: [
    StoreModule.forRoot(reducers),
    // Instrumentation must be imported after importing StoreModule (config is optional)
    StoreDevtoolsModule.instrument({
      maxAge: 25, // Retains last 25 states
      logOnly: environment.production, // Restrict extension to log-only mode
    }),
  ],
})
export class AppModule {}
Shimmery answered 2/10, 2018 at 20:25 Comment(1)
It's important to note that the order of the imports is important. StoreDevtoolsModule must be loaded after StoreModule.Hyoscyamus
O
0

If you have @ngrx/store-devtools installed and the store still doesn't show up (instead, you see No store found - blah blah blah instructions), context menu over the frame and select Reload Frame.

One of the tickets claimed that this workaround should no longer be necessary, but to me it was (Angular and store around v.7.2.x, Redux DevTools extension 2.17)

Ought answered 3/7, 2019 at 15:57 Comment(0)
E
0

Make sure you have installed the ngrx/store-devtools by following commands

npm install @ngrx/store-devtools --save

I want to put my two-cent experience that might be helpful for many of you. There is an order issue. You have to the add ngrx/store-devtools after the reducer. If you do not maintain the order, it will not work.

Elfriedeelfstan answered 23/6, 2020 at 7:14 Comment(0)
B
0

call instrument method in-app module to resolve this error.

Example-

 imports: [
        BrowserModule,
        AppRoutingModule,
        // StoreModule.forRoot({}),
        // StoreModule.forRoot(reducers, { metaReducers }),
    
        StoreModule.forRoot({ count: counterReducer }),
    
        // for debugging enable this instrument in development mode
        **!environment.production ? StoreDevtoolsModule.instrument() : [],**
    
        CustomerModule
    
      ],
Bregma answered 5/5, 2021 at 11:47 Comment(0)
D
0

I had the same problem... Then finally I tried running my app outside of VSCode debugger, and everything works fine. Somehow the debugger in VSCode doesn't allow you to see the Redux tab in Devtools

Dkl answered 3/8, 2022 at 4:55 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.