You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using ncc in a docker build with the oven/bun image, the build fails with the following error:
1.687 error: Module build failed (from ../tmp/@vercel/ncc--bunx/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js):
1.687 Error: Could not load TypeScript compiler with NPM package name `/tmp/@vercel/ncc--bunx/node_modules/@vercel/ncc/dist/ncc/typescript.js`. Are you sure it is correctly installed?
1.687 at loader (/tmp/@vercel/ncc--bunx/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache.js:32:279744)
1.687 at /tmp/@vercel/ncc--bunx/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:38:3792429
1.687 at /tmp/@vercel/ncc--bunx/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:38:792441
1.687 at _done (:9:0)
1.687 at processTicksAndRejections (:55:76)
1.687
------
Dockerfile:12
--------------------
10 | COPY src/ ./src
11 |
12 | >>> RUN bun x @vercel/ncc build ./src/index.ts -o ./dist
13 |
14 | FROM oven/bun:1.0.6-alpine as run
--------------------
ERROR: failed to solve: process "/bin/sh -c bun x @vercel/ncc build ./src/index.ts -o ./dist" did not complete successfully: exit code: 1
Adding nodejs to the Dockerfile solves this issue:
# build-stageFROM oven/bun:1.0.6-alpine as build
# vvvvvvvvvvvvvvvvvvvvvvv# uncommenting this line solves the issue# RUN apk add --no-cache nodejs# ^^^^^^^^^^^^^^^^^^^^^^^WORKDIR /build
# copy package.json & lockfileCOPY package.json bun.lockb ./
# install dependenciesRUN bun install
# add source codeCOPY tsconfig.json ./
COPY src/ ./src
# buildRUN bun x @vercel/ncc build ./src/index.ts -o ./dist
# run stageFROM oven/bun:1.0.6-alpine as run
WORKDIR /app
# copy the files from the build stageCOPY --from=build /build/package.json /build/bun.lockb ./
COPY --from=build /build/dist/ ./dist
# app go brrrrrrCMD [ "/bin/sh", "-c", "bun run dist/index.js 2>&1" ]
The text was updated successfully, but these errors were encountered:
When using ncc in a docker build with the
oven/bun
image, the build fails with the following error:Adding nodejs to the Dockerfile solves this issue:
The text was updated successfully, but these errors were encountered: