Skip to content

Commit 2077eb4

Browse files
freefaintpiotr-oles
authored andcommitted
Fix for android when doing yarn start (TypeStrong#157)
* Update index.ts Added hack for preventing crashing applications using this component on Android when nodejs doesn't have permissions to get hardware info and os.cpus returns undefined * fix fix after discussion with author
1 parent d8b0e13 commit 2077eb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ interface Options {
6666
class ForkTsCheckerWebpackPlugin {
6767
static DEFAULT_MEMORY_LIMIT = 2048;
6868
static ONE_CPU = 1;
69-
static ALL_CPUS = os.cpus().length;
69+
static ALL_CPUS = os.cpus() ? os.cpus().length : 1;
7070
static ONE_CPU_FREE = Math.max(1, ForkTsCheckerWebpackPlugin.ALL_CPUS - 1);
7171
static TWO_CPUS_FREE = Math.max(1, ForkTsCheckerWebpackPlugin.ALL_CPUS - 2);
7272

0 commit comments

Comments
 (0)