ngrx / store-log-monitor

Log Monitor for @ngrx/store-devtools and Angular
MIT License
63 stars 18 forks source link

ERROR in Error encountered resolving symbol values statically. Calling function 'useDockMonitor', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function #22

Closed guysenpai closed 7 years ago

guysenpai commented 7 years ago

OS

Windows 7

Versions

angular-cli: 1.0.0-beta.24 angular2: 2.4.1 node: 6.9.2 npm: 3.10.9

When I launch my app I get this error: ERROR in Error encountered resolving symbol values statically. Calling function 'useDockMonitor', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /.../app.module.ts, resolving symbol AppModule in /..../src/app/app.module.ts

marklagendijk commented 7 years ago

This is caused by this line. This is related to certain restrictions which are enforced, because of AOT.

Related issue on ngrx/store.

Solution might be to create the reducer as a function:

return reducer;

function reducer(){
    return compose(combineReducers)({
        position,
        visible,
        size
    });
}
paishin commented 7 years ago

Same problem here. I have converted my reducers to functions but that did not make issue go away. The problem starts in app.module.ts when using the following code:

StoreDevtoolsModule.instrumentStore({
      monitor: useLogMonitor({
        visible: false,
        position: 'right'
      })
    })

Update: the problem introduced itself after upgrading to angular-cli@1.0.0-beta.24

guysenpai commented 7 years ago

@paishin disable @ngrx/store-log-monitor and just use this in your module StoreDevtoolsModule.instrumentOnlyWithExtension() instead

StoreDevtoolsModule.instrumentStore({
      monitor: useLogMonitor({
        visible: false,
        position: 'right'
      })
    })

but comment the line in production. however check this https://github.com/vladotesanovic/angular2-express-starter/blob/master/src/app/store/index.ts

guysenpai commented 7 years ago

for using log monitor install this chrome extension [https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?utm_source=chrome-app-launcher-info-dialog]()

luchillo17 commented 7 years ago

@guysenpai That last link redirects on click to this issue, can you correct that link?

If not we are forced to copy-paste the link text into browser address bar to go to the intended link.

brandonroberts commented 7 years ago

The chrome/firefox extension is here: http://extension.remotedev.io/

luchillo17 commented 7 years ago

Just in case, for electron users you would need to configure electron to install such extensions, i have mine with Augury (by using it's id in the chrome extensions store), and Redux Devtools (by using the electron default REDUX_DEVTOOLS key in the electron-devtools-installer package).