noderaider / redux-idle-monitor

A Redux component to schedule events at stages of user idleness across multiple browser tabs.

Home Page:https://noderaider.github.io/redux-idle-monitor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consant errors from invariant dependenvy in DEV mode

marekadamek opened this issue · comments

redux-idle-monitor: 0.5.3
invariant: 2.2.2

Hello,

In dev mode (NODE_ENV !== 'production') invariant library throws errors every time a monitored action is fired. The error is as follows:

browser.js:26 Uncaught Error: invariant requires an error message argument
at invariant (browser.js:26)
at selectIdleState (actions.js:69)
at actions.js:48
at HTMLDocument.onActivity (actions.js:115)

and is caused by the line:
(0, _invariant2.default)((0, _typeof3.default)(state.idle) === 'object');

The problem for this is that second parameter for invariant function (format) is not passed. In the result it fails on the condition:

if (format === undefined) {
throw new Error('invariant requires an error message argument');
}

Could you confirm whether or not it'll be fixed?

Thanks,
Marek

@marekadamek thank you for opening. This is related to the most recent release. I'm fixing now should have something published shortly.

@marekadamek published fix to version v0.5.4. Can you npm i -S redux-idle-monitor@latest and let me know if you have any more issues?

Thanks!

@cchamberlain thanks for quick response and fast fix. Works well in v0.5.4. Great work!