P
Prisma•3w ago
villy

TypeError: client_1.Prisma.validator is not a function

I set up a nx monorepo application with nest js prisma and I have this error when I run a generated docker image for my nest js app.
2024-12-01 19:03:38 /app/api/main.js:283
2024-12-01 19:03:38 exports.transactionWithRelations = client_1.Prisma.validator()({
2024-12-01 19:03:38 ^
2024-12-01 19:03:38
2024-12-01 19:03:38 TypeError: client_1.Prisma.validator is not a function
2024-12-01 19:03:38 at Array.<anonymous> (/app/api/main.js:283:52)
2024-12-01 19:03:38
2024-12-01 19:03:38 Node.js v20.10.0
2024-12-01 19:03:38 /app/api/main.js:283
2024-12-01 19:03:38 exports.transactionWithRelations = client_1.Prisma.validator()({
2024-12-01 19:03:38 ^
2024-12-01 19:03:38
2024-12-01 19:03:38 TypeError: client_1.Prisma.validator is not a function
2024-12-01 19:03:38 at Array.<anonymous> (/app/api/main.js:283:52)
2024-12-01 19:03:38
2024-12-01 19:03:38 Node.js v20.10.0
FROM docker.io/node:20.10.0-alpine

ENV HOST=0.0.0.0
ENV PORT=3000

WORKDIR /app

RUN addgroup --system api && \
adduser --system -G api api

COPY dist/apps/api api/
RUN chown -R api:api .

# You can remove this install step if you build with `--bundle` option.
# The bundled output will include external dependencies.
RUN npm --prefix api --omit=dev -f install

CMD [ "node", "api" ]
FROM docker.io/node:20.10.0-alpine

ENV HOST=0.0.0.0
ENV PORT=3000

WORKDIR /app

RUN addgroup --system api && \
adduser --system -G api api

COPY dist/apps/api api/
RUN chown -R api:api .

# You can remove this install step if you build with `--bundle` option.
# The bundled output will include external dependencies.
RUN npm --prefix api --omit=dev -f install

CMD [ "node", "api" ]
I have this Dockerfile and I made sure to build my nest app and generated the prisma client before building it to the dist/apps and running the dockerfile
1 Reply
Nurul
Nurul•3w ago
Hello @villy 👋 Could you try including RUN npx prisma generate in your docker file to confirm that Prisma Client is generated?
Want results from more Discord servers?
Add your server