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

ora-based Logger crashes if run inside a docker container #1716

Closed
sebastian-schmitt opened this issue Jul 12, 2018 · 3 comments
Closed

ora-based Logger crashes if run inside a docker container #1716

sebastian-schmitt opened this issue Jul 12, 2018 · 3 comments
Labels

Comments

@sebastian-schmitt
Copy link

🐛 bug report

If parcel runs inside a docker-container, the logger crashes with the following output:

TypeError: this.stream.clearLine is not a function
    at Ora.clear (/usr/local/lib/node_modules/parcel-bundler/node_modules/ora/index.js:83:16)
    at Ora.render (/usr/local/lib/node_modules/parcel-bundler/node_modules/ora/index.js:92:8)
    at ontimeout (timers.js:427:11)
    at tryOnTimeout (timers.js:289:5)
    at listOnTimeout (timers.js:252:5)
    at Timer.processTimers (timers.js:212:10)

🎛 Configuration (.babelrc, package.json, cli command)

We're running parcel inside docker containers that get bootstrapped using docker-compose. There are no special configurations, neither at the docker - nor at the parcel side. Our docker-compose.yml file looks like this:

version: '3'
services:
  client:
    image: parcel
    container_name: bundler
    volumes:
      - ./src:/src
      - ./bundle:/bundle
    working_dir: /src
    command: bash -c "parcel watch main.ts -d /bundle"

the parcel image has been build via

docker build -t parcel .

from the following dockerfile:

FROM node:latest

RUN npm -g config set user root
RUN npm install -g typescript \
    && npm install -g parcel-bundler \
    && npm install -g nodemon \
    && npm cache clean --force

if you want to start a bash inside this docker-container instead of crashing it immediately, you could modify the docker-compose.yml file like this:

version: '3'
services:
  client:
    image: parcel
    container_name: bundler
    volumes:
      - ./src:/src
      - ./bundle:/bundle
    working_dir: /src
    entrypoint: /bin/sh
    stdin_open: true
    tty: true

💁 Possible Solution

I had a look at this and this thread and tried to disable the ora-stream by setting the CI-environment variable to 1 using the docker-compose environment setting like this:

version: '3'
services:
  client:
    image: parcel
    container_name: bundler
    environment:
        - CI=1
    [...]

but it seems to be ignored in the parcel-scenario. I finally modified this line here to

enabled: !this.isTest && !process.env.CI

which (combined with the previous CI-environment-variable-setting) solved the issue for me. Since the output still looks somehow tangled, I guess my "solution" is either not complete or even follows the wrong trail.

Thank you very much for any help! I really love your work!

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Jul 12, 2018

Parcel version?

Related to #1712 ?

@sebastian-schmitt
Copy link
Author

oh sorry: it is 1.9.5

@DeMoorJasper
Copy link
Member

Try 1.9.6 it should fix some ora errors

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

3 participants