modern.js icon indicating copy to clipboard operation
modern.js copied to clipboard

[Bug]: Error build Modern.js using bun inside docker

Open vincentzhangz opened this issue 8 months ago • 2 comments

Version

bunx envinfo --system --browsers --npmPackages '@modern-js/*'

System:
  OS: Linux 6.8 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (4) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 752.99 MB / 7.75 GB
  Container: Yes
  Shell: 5.2.15 - /bin/bash
npmPackages:
  @modern-js/app-tools: 2.67.3 => 2.67.3
  @modern-js/runtime: 2.67.3 => 2.67.3
  @modern-js/tsconfig: 2.67.3 => 2.67.3

Details

I tried to build Modern.js project with bun using docker. But when running the bunx modern deploy or using pnpx modern deploy it got this error.

this is my modern.config.ts

import { appTools, defineConfig } from '@modern-js/app-tools';
import tailwindPostcssPlugin from '@tailwindcss/postcss';

export default defineConfig({
  runtime: {
    router: true,
  },
  server: {
    ssr: true,
    port: 3000,
  },
  plugins: [
    appTools({
      bundler: 'rspack', // Set to 'webpack' to enable webpack
    }),
  ],
  tools: {
    postcss: (_, { addPlugins }) => {
      addPlugins(tailwindPostcssPlugin);
    },
  },
  source: {
    globalVars: {
      'process.env.URL_API': process.env.URL_API,
    },
  },
});
Image

is there any solution ?

Reproduce link

Reproduce Steps

# Dockerfile
FROM oven/bun:1.2 AS deps
WORKDIR /app

COPY package.json ./
RUN bun install --verbose

COPY . .

RUN bunx modern deploy

FROM oven/bun:1.2 AS release
WORKDIR /app
COPY --from=deps /app .
CMD ["bun", "serve"]

vincentzhangz avatar May 09 '25 10:05 vincentzhangz

Can't able to reproduce it in my environment. Can you provide a repository?

zllkjc avatar May 09 '25 10:05 zllkjc

Can't able to reproduce it in my environment. Can you provide a repository?

This is the sample code https://filebin.net/z2k3sgwyfd63qyxl

I run it with the sample Dockerfile and got the same error.

vincentzhangz avatar May 09 '25 11:05 vincentzhangz