Parcel: Addition of ora spinner fails on Jenkins/CI

Created on 11 Jul 2018  路  8Comments  路  Source: parcel-bundler/parcel

馃悰 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

Bug

All 8 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devongovett picture devongovett  路  3Comments

dsky1990 picture dsky1990  路  3Comments

will-stone picture will-stone  路  3Comments

davidnagli picture davidnagli  路  3Comments

davidnagli picture davidnagli  路  3Comments