{
"code": "UNKNOWN",
"message": "undefined is not an object (evaluating 'K[q]')",
"details": ""
}
Logs
kando-1 | err: {
kando-1 | "type": "TypeError",
kando-1 | "message": "undefined is not an object (evaluating 'K[q]')",
kando-1 | "stack":
kando-1 | TypeError: undefined is not an object (evaluating 'K[q]')
kando-1 | at bearer (/usr/src/app/node_modules/@elysiajs/bearer/dist/index.mjs:35:19)
kando-1 | at assign (native)
kando-1 | at <anonymous> (file:///usr/src/app/dist/index.js:68:19)
kando-1 | at processTicksAndRejections (:12:39)
kando-1 | "originalLine": 1158,
kando-1 | "originalColumn": 21136
kando-1 | }
This generally occurs randomly, works fine on local setup but after deploying on docker it throws this.
This is my dockerfile
FROM oven/bun:1.1.29-slim AS serve-image
RUN apt update && apt install dumb-init wget -y && apt-get clean && rm -rf /var/lib/apt/lists/*
FROM imbios/bun-node:1.1.29-22.9.0-slim AS base
FROM base AS deps
WORKDIR /usr/src/app
COPY bun.lockb package.json ./
RUN --mount=type=cache,id=bun-cache,target=/root/.bun bun install --frozen-lockfile
FROM deps AS build
WORKDIR /usr/src/app
COPY . .
RUN bun prisma generate && bun build src/index.ts --outdir ./dist --target bun --minify --sourcemap
FROM base AS prod-deps
WORKDIR /usr/src/app
COPY bun.lockb package.json prisma/ ./
RUN --mount=type=cache,id=bun-cache,target=/root/.bun bun install --frozen-lockfile --production && bun prisma generate
FROM serve-image AS final
WORKDIR /usr/src/app
COPY --from=prod-deps /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/public ./public
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/prisma ./prisma
COPY --from=build /usr/src/app/package.json ./package.json
CMD ["dumb-init", "bun", "run", "dist/index.js"]
USER bun
EXPOSE 3000
EXPOSE 3001
Logs
This generally occurs randomly, works fine on local setup but after deploying on docker it throws this. This is my dockerfile
This is my compose.yaml