parcel icon indicating copy to clipboard operation
parcel copied to clipboard

Parcel build hangs while building docker image for `linux/amd64`

Open tankakatan opened this issue 1 year ago • 1 comments

🐛 bug report

Hi everyone,

I have a problem building a Node.js v22 docker image for linux/amd64 platform from my parcel-bundled app on M2 MBP.

The same image gets built without errors if I don't specify the target platform.

I build docker images from my other Node.js v22 apps, for the specified platform without errors if Parcel is not used. Therefore the problem doesn't seem to be related to my docker or OS configuration.

I prepared a minimal setup to reproduce the issue, please see below.

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

parcel build ./index.tsx

🤔 Expected Behavior

The app gets bundled without errors.

😯 Current Behavior

The build command hangs forever, producing no output at all. Adding --trace and/or --log-level=verbose flags makes no effect.

💁 Possible Solution

I had to downgrade my Node version to v21 in order to make it work.

I tried to change some of my local docker configurations, like setting up QEMU and using buildx, and enabling experimental features in my docker engine, but unfortunately it doesn't help.

🔦 Context

The issue forces me to fallback to older version of Node.js.

💻 Code Sample

Here's a docker file that I use to reproduce the issue:

FROM node:22.0

WORKDIR /app

RUN echo "console.log('Hello world');" > index.tsx
RUN npm i parcel
RUN node ./node_modules/parcel/lib/cli.js build ./index.tsx

The problem occurs when I try to build the image using the following command:

docker build --platform linux/amd64 -t foo:bar -f Dockerfile .

🌍 Your Environment

Software Version(s)
Parcel 2.12
Node v22.0 and above
npm/Yarn 10.8.1
Operating System macOS 14.5, build 23F79
CPU Apple M2 Max
Docker 27.0.3, build 7d4bcd8

tankakatan avatar Jul 08 '24 13:07 tankakatan

I get the same hanging building an unrelated Node 22 app, whereas the arm build succeeds. Previous versions of Node succeeded.

chrischen avatar Aug 17 '24 05:08 chrischen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

github-actions[bot] avatar Feb 13 '25 12:02 github-actions[bot]