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.
Running parcel should disable the spinner in environments where it is unsupported.
Running on Jenkins fails immediately when attempting to display the ora spinner when clearLine is unavailable.
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.
Blocked from upgrading to the latest version of Parcel because of this unexpected break.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.5
| Node | 9
| npm/Yarn | 6
| Operating System | darwin-x64 MacOSX via Jenkins
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.
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.
We can probably contribute a fix for that back to ora @icopp
@DeMoorJasper From their issues it looked like they actively avoided fixing it for some reason, so I would personally be pessimistic there.
@devongovett I think this would help too? https://github.com/sindresorhus/ora/pull/82
(without having to muck with enabled/disabled opt)
lol we're all hitting this same issue.
Should be fixed in 8670fd6. Released in v1.9.6.
@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.
Good work everyone! Thanks for the quick fix.