Vite build hang infenitly

My project use bun + svelte + vite.
vite build output done but never finished and node process still in memory ,

node /usr/src/app/node_modules/.bin/vite build
+] Building 306.6s (13/16)                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                              0.4s
 => => transferring dockerfile: 1.80kB                                                                                                                            0.1s
 => [internal] load metadata for docker.io/oven/bun:1                                                                                                             2.5s
 => [internal] load .dockerignore                                                                                                                                 0.2s
 => => transferring context: 2B                                                                                                                                   0.0s
 => [internal] load build context                                                                                                                                 0.5s
 => => transferring context: 207.86kB                                                                                                                             0.2s
 => [base 1/2] FROM docker.io/oven/bun:1@sha256:fbf8e67e9d3b806c86be7a2f2e9bae801f2d9212a21db4dcf8cc9889f5a3c9c4                                                  0.0s
 => CACHED [base 2/2] WORKDIR /usr/src/app                                                                                                                        0.0s
 => CACHED [production 1/3] WORKDIR /usr/src/app                                                                                                                  0.0s
 => CACHED [install 1/4] RUN mkdir -p /temp/dev                                                                                                                   0.0s
 => [install 2/4] COPY package.json bun.lock /temp/dev/                                                                                                           2.1s
 => [install 3/4] RUN cd /temp/dev && bun install --frozen-lockfile                                                                                              79.4s
 => [install 4/4] RUN cd /temp/dev && bun add -D @rollup/rollup-linux-arm64-gnu                                                                                  15.5s 
 => CACHED [builder 1/3] COPY --from=install /temp/dev/node_modules node_modules                                                                                  0.0s 
 => [builder 2/3] COPY . .                                                                                                                                        1.5s 
 => [builder 3/3] RUN bun run build                                                                                                                             189.3s 
 => => # built in 36117ms.                                                                                                                                             
 => => # Run npm run preview to preview your production build locally.                                                                                                 
 => => # > Using @sveltejs/adapter-auto                                                                                                                               
 => => #   Could not detect a supported production environment. See https://svelte.dev/docs/kit/adapters to learn how to configure your app to run on the platform of 
 => => # your choosing                                                                                                                                                
 => => #   ✔ done          

On which platform are you running the build? Mac, Windows, Linux? Are you using Docker CE or Docker Desktop?

Could it be that the node process is still waiting for pressing enter or any user interaction? You could try creating an image without the RUn instruction that runs the build and start a shell in a container created from it so you can run the build command interactively.

My only idea for the hanging process is that you are emulating an architetcure even if you don’t know about it. For example I remember node issues reported when the host was macOS with an ARM CPU and the emulation didn’t work perfectly.

The issue could also be related to the previous warning about the production environment. I’m just guessing, but I found this for you

But first, I would try running the build command interactively in a shell in a container.