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

cannot read property 'length' of undefined #150

Closed
superlbr opened this issue Aug 11, 2018 · 3 comments
Closed

cannot read property 'length' of undefined #150

superlbr opened this issue Aug 11, 2018 · 3 comments

Comments

@superlbr
Copy link
Contributor

in some env., os.cpus is undefined, such as turmux-app.
https://github.com/Realytics/fork-ts-checker-webpack-plugin/blob/db649e320e9350a098c7b854a1db35c9306d407c/src/index.ts#L69

@johnnyreilly
Copy link
Member

Do you want to submit a PR that tests for the existence of cpus before reading then?

@superlbr
Copy link
Contributor Author

static ALL_CPUS = os.cpus() ? os.cpus().length : 1;

Well, since cpus is not defined in os, os.cpus() will still throw an error, I guess.Why not

static ALL_CPUS = os.cpus ? os.cpus().length : 1;

@johnnyreilly
Copy link
Member

Sure - submit a PR!

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

2 participants