Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Docker-based Parcel Build does not work on CircleCI (and likely other CI platforms)

See original GitHub issue

In 1.38.0, the build was moved into a docker container by this PR:

This is causing builds to fail on our CircleCI platform used for continuous delivery of CDK changes.

The issue

You can see the error in the CircleCI interface here:

We can easily start up docker-in-docker by using Circle’s setup_remote_docker command.

However, when the parcel image tries to run lscpu, the failure causes the build to break.

#!/bin/bash -eo pipefail
npx cdk synth

Failed to build file at /home/circleci/project/lib/index.ts: Error: [Status 1] stdout: 🚨  No entries found.

    at Bundler.bundle (/usr/local/share/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:275:17)

stderr: /bin/sh: lscpu: not found

Subprocess exited with error 1
Exited with code exit status 1
CircleCI received exit code 1

There are a number of issues on the parcel issue tracker about this issue on CI platforms:

Reproduction Steps

I’ve created this example repo to show the problem:

Error Log

Failed to build file at /home/circleci/project/lib/index.ts: Error: [Status 1] stdout: 🚨  No entries found.

    at Bundler.bundle (/usr/local/share/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:275:17)

stderr: /bin/sh: lscpu: not found


  • CLI Version : 1.38.0
  • Framework Version: 1.38.0
  • OS : MacOS / Ubuntu (on CircleCI)
  • Language : English


A fix

I can confirm that passing the PARCEL_WORKERS environment variable to the docker run parcel-bundler image resolves the problem. I got the idea to try that from this comment on the parcel side:

I used CircleCI’s SSH feature to interactively test this.

circleci@0d67793e2a50:~/project$ docker run parcel-bundler
Server running at http://localhost:1234
/bin/sh: lscpu: not found
🚨  No entries found.
    at Bundler.bundle (/usr/local/share/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:275:17)
    at async Bundler.serve (/usr/local/share/.config/yarn/global/node_modules/parcel-bundler/src/Bundler.js:842:7)
    at async Command.bundle (/usr/local/share/.config/yarn/global/node_modules/parcel-bundler/src/cli.js:241:20)

no errors when passing the PARCEL_WORKERS param.

circleci@0d67793e2a50:~/project$ docker run parcel-bundler -e PARCEL_WORKERS=2


Most all CI platforms set the CI environment variable to true. Maybe if CI is set, CDK automatically passes the PARCEL_WORKERS parameter in the docker run args?

Alternatively, you could try to fix this problem in the docker image itself if lscpu is not present.

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

blimmercommented, Jun 30, 2020

For others that might be running into this problem in CircleCI, I highly recommend switching from the Docker executor to the Machine executor. Even with the improvements referenced in this ticket, there are still issues with how CircleCI runs docker-in-docker that causes tons of headaches with lambda bundling.

Simply change your job definition from something like this:

  - image: circleci/node:lts

to using a machine executor like this:

  image: ubuntu-1604:202004-01
TLaddcommented, Dec 23, 2020

Ended up here because I was having trouble getting our cdk deploy running in CircleCI. Can confirm that switching to the machine executor still works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Server Installations - CircleCI
This document describes an initial set of troubleshooting steps to take if you are having problems with your CircleCI installation on your private...
Read more >
Note: Unit number 2,3,4,5 is available
a packet from one network to another network to the microservices. ... a problem is coming to create a new feature or module...
Read more >
NodeJS jobs from Hacker News 'Who is hiring? (July 2021)' post
We're looking for strong engineers with many of the following: * 3+ years of full-time software engineering experience * Experience building ...
Read more >
Top Amazon Elastic Container Registry (ECR) Alternatives in 2022
Container Registry, which is built using object storage, provides high ... Push private images to run them in the IBM Cloud®, Kubernetes Service...
Read more >
Remote Developer + Engineer + Engineering + Full Stack Jobs with ...
Browse 20+ Remote Developer Engineer Engineering Full Stack Jobs in November 2022 at companies like Simple Poll, Sana Benefits and Flyp with salaries...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found