-
Bug descriptionI am getting the following error:
when trying to open FROM node:18-alpine as base
ENV NEXT_TELEMETRY_DISABLED 1
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# enbable corepack to use pnpm
RUN corepack enable
COPY . /pulsecare-webapp
WORKDIR /pulsecare-webapp
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm exec next telemetry disable
# Trying to freshly install prisma client every time as suggested here: https://github.com/prisma/prisma/issues/7234#issuecomment-846606919
RUN pnpm add prisma @prisma/client
RUN DEBUG='*' pnpm dlx prisma generate
FROM deps as production-bundle
RUN pnpm build
FROM deps as development
EXPOSE 3000
CMD ["pnpm", "dev"]
FROM production-bundle as production
EXPOSE 3000
CMD ["pnpm", "start"]
Service definition in docker-compose.yaml web_dev:
profiles:
- dev
restart: always
environment:
- MONGODB_URL=mongodb://localhost:27018/PulseCare
# For WSL: https://www.reddit.com/r/nextjs/comments/1638ec6/comment/jy1h8ys/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
- WATCHPACK_POLLING=true
build:
context: ..
dockerfile: docker/Dockerfile
target: development
ports:
- "3000:3000"
# This port to test `pnpm run dev` from within the container
- "3001:3001"
depends_on:
- mongo6
links:
- mongo6
# This is only for hot reload in development
volumes:
- ../:/pulsecare-webapp
- /pulsecare-webapp/node_modules
- /pulsecare-webapp/.next Although, if I run How to reproduceRun the following commands
docker compose -f ./docker/docker-compose.yaml -p pulsecare-web --profile dev up -d -V --build
import { PrismaClient } from "@prisma/client";
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma = globalForPrisma.prisma || new PrismaClient();
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
export default prisma;
}); Environment & setup
Prisma Version
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I encountered the same issue when attempting to build a next-js project with Changing from "@prisma/client": "^5.12.1",
"prisma": "^5.12.1", to version "@prisma/client": "5.10.2",
"prisma": "5.10.2", fixed it for me. I did not check for any version in between. |
Beta Was this translation helpful? Give feedback.
-
Thanks @matt-roz ! |
Beta Was this translation helpful? Give feedback.
-
I have been running into this error too, I worked around it by following creating a new workspace folder, e.g. Adding a basic
Changing the schema to generate to And adding I tried the downgrade approach but would sporadically run into errors where it still couldn't resolve |
Beta Was this translation helpful? Give feedback.
I encountered the same issue when attempting to build a next-js project with
pnpm
(npm
works just fine).Changing from
to version
fixed it for me. I did not check for any version in between.