swc not compatible with bun docker
it's working
it's error
the error
FROM node:22.15.0-slim AS builder
WORKDIR /app
# Install Bun
RUN apt-get update && apt-get install -y curl unzip \
&& curl -fsSL https://bun.sh/install | bash \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/root/.bun/bin"
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps
RUN bun run build
FROM node:22.15.0-slim AS builder
WORKDIR /app
# Install Bun
RUN apt-get update && apt-get install -y curl unzip \
&& curl -fsSL https://bun.sh/install | bash \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/root/.bun/bin"
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps
RUN bun run build
FROM oven/bun:latest AS builder
WORKDIR /app
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps (ERROR HERE)
RUN bun run build
FROM oven/bun:latest AS builder
WORKDIR /app
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps (ERROR HERE)
RUN bun run build
$ swc src -d dist
this.publicInterface = publicInterface;
this.taskQueue = options.taskQueue || new task_queue_1.ArrayTaskQueue();
const filename = options.filename ? (0, common_1.maybeFileURLToPath)(options.filename) : null;
this.options = { ...kDefaultOptions, ...options, filename, maxQueue: 0 };
if (this.options.recordTiming) {
this.runTime = (0, node_perf_hooks_1.createHistogram)();
^
error: Not implemented
at new ThreadPool (/app/node_modules/piscina/dist/index.js:95:50)
at new Piscina (/app/node_modules/piscina/dist/index.js:570:53)
at initialCompilation (/app/node_modules/@swc/cli/lib/swc/dir.js:83:25)
$ swc src -d dist
this.publicInterface = publicInterface;
this.taskQueue = options.taskQueue || new task_queue_1.ArrayTaskQueue();
const filename = options.filename ? (0, common_1.maybeFileURLToPath)(options.filename) : null;
this.options = { ...kDefaultOptions, ...options, filename, maxQueue: 0 };
if (this.options.recordTiming) {
this.runTime = (0, node_perf_hooks_1.createHistogram)();
^
error: Not implemented
at new ThreadPool (/app/node_modules/piscina/dist/index.js:95:50)
at new Piscina (/app/node_modules/piscina/dist/index.js:570:53)
at initialCompilation (/app/node_modules/@swc/cli/lib/swc/dir.js:83:25)
3 Replies
my
.swcrc
file
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"],
"@core/*": ["src/core/*"],
"@config/*": ["src/core/config/*"],
"@utils/*": ["src/utils/*"],
"@module/*": ["src/modules/*"]
},
"target": "es2022",
"keepClassNames": true,
"loose": true
},
"module": {
"type": "commonjs",
"strict": true
},
"sourceMaps": false,
"minify": true
}
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"],
"@core/*": ["src/core/*"],
"@config/*": ["src/core/config/*"],
"@utils/*": ["src/utils/*"],
"@module/*": ["src/modules/*"]
},
"target": "es2022",
"keepClassNames": true,
"loose": true
},
"module": {
"type": "commonjs",
"strict": true
},
"sourceMaps": false,
"minify": true
}
It’s a bug og bun
Maybe, yeah. I already tried asking in their Discord too—just waiting for a reply now