store-devtools icon indicating copy to clipboard operation
store-devtools copied to clipboard

Property 'instrumentOnlyWithExtension' does not exist on type 'typeof StoreDevtoolsModule'.

Open daituzhang opened this issue 6 years ago • 4 comments

Hi, I got this error when I try to import StoreDevtoolsModule.instrumentOnlyWithExtension()

I'm using: angular/core: "^4.0.0", "@ngrx/core": "^1.2.0", "@ngrx/store": "^2.2.3", "@ngrx/store-devtools": "^3.2.4", "typescript": "~2.3.3" Does anyone know why?

Thank you!!

daituzhang avatar Aug 10 '17 16:08 daituzhang

I found that you need to use only instrument StoreDevtoolsModule.instrument()

but I have these versions:

"@ngrx/core": "^1.2.0",
"@ngrx/store": "^4.0.2",
"@ngrx/store-devtools": "^4.0.0",

JloMexmax avatar Aug 10 '17 23:08 JloMexmax

What @JloMexmax posted will enable it in production aswell. What you can do as of v4 is put the following as an import. (assuming you have the environment.production variable) !environment.production ? StoreDevtoolsModule.instrument() : []

grizzm0 avatar Aug 19 '17 00:08 grizzm0

@grizzm0 Thanks for the fix. I'm new to ngrx, and been experiencing a lot of difficulty finding correct information for v4, your example works well.

krismeister avatar Sep 25 '17 12:09 krismeister

What if we want to still enable it in production if the extension exists?

mfp22 avatar Oct 17 '17 16:10 mfp22