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

Plugin doesn't work on Virtual Machines with ubuntu when numWorkers != 1 #53

Closed
dumistoklus opened this issue Oct 7, 2018 · 8 comments

Comments

@dumistoklus
Copy link

dumistoklus commented Oct 7, 2018

I tried to build my code on dev machine Windows - it works fine.

Then I tried to build code on VM (VirtualBox) with Ubuntu 16.04 and 18.04 build was stop without any error. Building was stopped on step "./js/article.ts → ./www/build/article.js..."

Step by step I found a heart of bug - "numWorkers". If I set numWorkers to "1" then building work fine. otherwise, stop without error.

@TrySound
Copy link
Owner

TrySound commented Oct 8, 2018

Does it work when numWorkers is not set?

@TrySound
Copy link
Owner

TrySound commented Oct 8, 2018

This is the default value. Is it lying?

import os from 'os';
os.cpus().length - 1

@dumistoklus
Copy link
Author

dumistoklus commented Oct 8, 2018

Does it work when numWorkers is not set?

no

This is the default value. Is it lying?
import os from 'os'; os.cpus().length - 1

I think it's a problem place.
What happens when I have only one CPU?

@dumistoklus
Copy link
Author

@TrySound well?

@TrySound
Copy link
Owner

It's jest bug. Fixed in master. For now you may specify numWorkers explicitly

Math.max(1, os.cpus().length - 1)

Ref jestjs/jest#7181

danielnaab added a commit to danielnaab/waterdataui that referenced this issue Nov 2, 2018
@hatashiro
Copy link

So the following workaround fixes this issue.

uglify({ numWorkers: 1 })

I think it's kinda critical, because it doesn't print any error and just silently fails to generate output.

@TrySound
Copy link
Owner

@utatti You may use rollup-plugin-terser. Terser is less buggy than uglify.

@TrySound
Copy link
Owner

Guys, I upgraded jest-worker to version which sets minimal numWorkers to 1. You may remove that option now.

I still recommend to migrate to terser.

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