Skip to content

Error when using shippable #95

Closed
Closed

Description

@arunoda

I'm getting this error when used progress inside a service called Shippable. (a CI server)
I'm using [email protected].
What should be the issue?

/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/progress/lib/node-progress.js:168
this.stream.clearLine();
^
TypeError: Object # has no method 'clearLine'
at ProgressBar.terminate (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/progress/lib/node-progress.js:168:17)
at ProgressBar.tick (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/progress/lib/node-progress.js:91:10)
at ProgressBar.update (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/progress/lib/node-progress.js:157:8)

Activity

  1. jdan commented on May 1, 2015

    @jdan
    Collaborator

    Can you elaborate a little more on how you're using the progress module? Can you paste the code that uses it?

  2. jonrouleau commented on May 1, 2015

    @jonrouleau

    I don't see anything directly wrong with your usage. You're not setting a custom stream, so we default to process.stderr. Is your application doing anything funny to the default streams or perhaps running in an environment where they don't exists? Maybe you need to pass a custom stream with the stream option? See the Readme for more information.

    I have run mocha on both arunoda/nodemiral@3f90a0a (master) and arunoda/nodemiral@46371b3 and am not receiving any failures.

  3. arunoda commented on May 1, 2015

    @arunoda
    Author

    I don't get this normally as well. May be something with the shippable
    infrastructure. I'll keep digging.

    On Fri, May 1, 2015 at 11:36 AM Jonathan Rouleau [email protected]
    wrote:

    I don't see anything directly wrong with your usage. You're not setting a
    custom stream, so we default to process.stderr. Is your application doing
    anything funny to the default streams or perhaps running in an environment
    where they don't exists? Maybe you need to pass a custom stream with the
    stream option? See the Readme
    https://github.com/tj/node-progress/blob/master/Readme.md for more
    information.

    I have run mocha on both arunoda/nodemiral@3f90a0a
    arunoda/nodemiral@3f90a0a
    (master) and arunoda/nodemiral@46371b3
    arunoda/nodemiral@46371b3
    and am not receiving any failures.

    —
    Reply to this email directly or view it on GitHub
    #95 (comment).

  4. bahmutov commented on Mar 31, 2017

    @bahmutov
    Contributor

    I have the same error trying to use inside the Docker container

  5. bahmutov commented on Mar 31, 2017

    @bahmutov
    Contributor

    Example code causing a problem

    var ProgressBar = require('progress');
    
    var bar = new ProgressBar(':bar', { total: 10 });
    var timer = setInterval(function () {
      bar.tick();
      bar.clear = true
      bar.terminate()
      if (bar.complete) {
        console.log('\ncomplete\n');
        clearInterval(timer);
      }
    }, 100);

    Dockerfile for this

    from node:7
    copy package.json /
    run npm install
    copy index.js /
    cmd ["node", "index.js"]
    

    Build image and run it command

    docker build -t progress .
    docker run progress
    

    Error in the output

    /node_modules/progress/lib/node-progress.js:177
        this.stream.clearLine();
                    ^
    TypeError: this.stream.clearLine is not a function
        at ProgressBar.terminate (/node_modules/progress/lib/node-progress.js:177:17)
        at Timeout._onTimeout (/index.js:7:7)
        at ontimeout (timers.js:386:14)
        at tryOnTimeout (timers.js:250:5)
        at Timer.listOnTimeout (timers.js:214:5)
    
  6. bahmutov commented on Mar 31, 2017

    @bahmutov
    Contributor

    A simple guard prevents the crash

    ProgressBar.prototype.terminate = function () {
      if (this.clear) {
        if (this.stream.clearLine) {
          this.stream.clearLine();
          this.stream.cursorTo(0);
        }
      } else console.log();
    };
  7. added a commit that references this issue on Mar 31, 2017
    8ef3972
  8. added a commit that references this issue on Apr 2, 2017
    b06fd63
  9. sabberworm commented on Jul 1, 2019

    @sabberworm

    There are still two usages of stream.clearLine left that would also need a guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions