Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: window is not defined (moment-duration-format) #1281

Closed
pdcastro opened this issue Jun 4, 2019 · 3 comments
Closed

ReferenceError: window is not defined (moment-duration-format) #1281

pdcastro opened this issue Jun 4, 2019 · 3 comments
Assignees

Comments

@pdcastro
Copy link
Contributor

pdcastro commented Jun 4, 2019

A dependency of the balena CLI, moment-duration-format was udpated from v2.2.2 to v2.3.0 and this is causing the CLI to break. I've first noticed it during the CLI builds:

C:\Users\Administrator\concourse\work\volumes\live\52cab583-cff9-4400-44e1-0e7b3683d1d4\volume\node_modules\moment-duration-format\lib\moment-duration-format.js:1723
        if (window.Intl && window.Intl.NumberFormat) {
        ^
ReferenceError: window is not defined
...

I've also opened an issue in their repo: jsmreese/moment-duration-format#131

Affects fresh npm installations of balena CLI version 10.17.4 and "all others before that".
I believe it does not affect installations with the standalone zip file.

@pdcastro
Copy link
Contributor Author

pdcastro commented Jun 4, 2019

Anyone affected may also need to delete the .fast-boot.json file from the balena-cli's folder and/or the ./bin/ subfolder (i.e. ./bin/.fast-boot.json subfolder). Otherwise, the CLI may fail with an unhelpful error message:

$ ./bin/balena version
null

Btw, @shaunmulligan, @thgreasi, that's a downside I have noticed with the .fast-boot.json file: when I switch branches I got in habit of deleting the .fast-boot.json file to avoid those null errors. But so far I am not aware of users reporting this error, I've only noticed it myself.

@Martii
Copy link

Martii commented Jun 4, 2019

... causing the CLI to break ...

And the API usage of moment-duration-format. Thanks for reporting this upstream as we just encountered this in a different project not too long ago. :) *watching that issue*

@thgreasi
Copy link
Member

thgreasi commented Jun 4, 2019

@Martii this should now be resolved in CLI version 10.17.5 and later (PR #1282).
Can you try updating your balena-cli installation and give us a note if that's still an issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants