jsmreese/moment-duration-format

ReferenceError: window is not defined in v2.3.0

pdcastro opened this issue · 2 comments

My Node.js CI build started failing with the following error, apparently as a result of an update from v2.2.2 to v2.3.0:

node_modules\moment-duration-format\lib\moment-duration-format.js:1723
        if (window.Intl && window.Intl.NumberFormat) {
        ^
ReferenceError: window is not defined

Perhaps a regression of #81 (ReferenceError: window is not defined (2.0.0))?

Probably connected to PR #122, merged a few hours ago.

Workaround: pinning to version ~2.2.2.

Thanks, and sorry for neglecting to run the tests on node. Really should have automated that!

Page- commented

I think this is still an issue because window doesn't exist at all so the safe check is typeof window !== 'undefined' && ...