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

Addition of ora spinner fails on Jenkins/CI #1711

Closed
bigtimebuddy opened this issue Jul 11, 2018 · 8 comments
Closed

Addition of ora spinner fails on Jenkins/CI #1711

bigtimebuddy opened this issue Jul 11, 2018 · 8 comments
Labels

Comments

@bigtimebuddy
Copy link

bigtimebuddy commented Jul 11, 2018

🐛 bug report

After upgrading to the latest 1.9.5 version, the introduction of ora #1472 is producing the following error running on Jenkins or CI:

TypeError: this.stream.clearLine is not a function
     at Ora.clear (/apps/jenkins/workspace/project-name/node_modules/ora/index.js:83:16)
     at Ora.render (/apps/jenkins/workspace/project-name/node_modules/ora/index.js:92:8)
     at ontimeout (timers.js:478:11)
     at tryOnTimeout (timers.js:302:5)
     at Timer.listOnTimeout (timers.js:262:5)

According to ora source, when enabled is always set, it ignores the process.env.CI var, which can be used to disable the spinner.

🤔 Expected Behavior

Running parcel should disable the spinner in environments where it is unsupported.

😯 Current Behavior

Running on Jenkins fails immediately when attempting to display the ora spinner when clearLine is unavailable.

💁 Possible Solution

Temporary workaround would be to set export NODE_ENV=test, to disable the spinner, but this is not ideal since it conflicts with the use of NODE_ENV as production or development. This also breaks with how v1.9.4 worked. Ideally, environment detection for enabling the spinner should happen internally.

🔦 Context

Blocked from upgrading to the latest version of Parcel because of this unexpected break.

🌍 Your Environment

Software Version(s)
Parcel 1.9.5
Node 9
npm/Yarn 6
Operating System darwin-x64 MacOSX via Jenkins
@devongovett
Copy link
Member

devongovett commented Jul 11, 2018

Thanks. I think we should change this line: https://github.com/parcel-bundler/parcel/pull/1472/files#diff-ee6e6eca9dc30e7f279fcadf6f6b9346R129

enabled: this.isTest ? false : undefined

This way it will fall back to the ora default except in the tests.

@icopp
Copy link

icopp commented Jul 11, 2018

ora also fails on Docker, which I just encounted while trying to run parcel-bundler via Bitbucket Pipelines. It looks like they've never added any fix for this, so Parcel will need to add an extra test or workaround for that case.

@DeMoorJasper
Copy link
Member

We can probably contribute a fix for that back to ora @icopp

@icopp
Copy link

icopp commented Jul 11, 2018

@DeMoorJasper From their issues it looked like they actively avoided fixing it for some reason, so I would personally be pessimistic there.

@gobengo
Copy link

gobengo commented Jul 11, 2018

@devongovett I think this would help too? sindresorhus/ora#82

(without having to muck with enabled/disabled opt)

lol we're all hitting this same issue.

@devongovett
Copy link
Member

Should be fixed in 8670fd6. Released in v1.9.6.

@devongovett
Copy link
Member

@gobengo Thanks for making that PR for ora - that should also get merged I hope and fix some other classes of issue. But this should fix CI for now since ora already checks for tty unless we explicitly enable it as we were before.

@bigtimebuddy
Copy link
Author

Good work everyone! Thanks for the quick fix.

devongovett added a commit that referenced this issue Oct 15, 2018
devongovett added a commit that referenced this issue Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants