zenstackhq / zenstack

Fullstack TypeScript toolkit enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
1.89k stars 81 forks source link

[Bug] Issues with zenstack generate Command During Docker Image Build #1485

Open Siykt opened 1 month ago

Siykt commented 1 month ago

Description and Expected Behavior

When compiling a Docker image, the zenstack generate command fails to execute properly, displaying an error indicating that Prisma is not found. The command seems to only support a globally installed version of Prisma. This dependency on a global installation significantly increases the length of my Docker build process and prevents the exclusion of packages that are not needed in the production environment. The expected behavior is for zenstack generate to work with a locally installed version of Prisma, allowing for a more efficient and streamlined Docker build process.

Screenshots

remove RUN pnpm add prisma -g

image

or use pnpx run

image

Environment (please complete the following information):

ymc9 commented 1 month ago

Hi @Siykt , ZenStack runs prisma with a normal "npx prisma" command so it shouldn't require prisma to be globally installed. In fact, most of the projects that use ZenStack have prisma installed only locally.

Does your project build successfully outside of docker? Just wondering if it's specific to running inside docker.

Siykt commented 1 month ago

I appreciate your response @ymc9 . I'm using Windows 10 and managing packages with pnpm, but I can't successfully execute pnpm zenstack generate locally. It only works when I add the global prisma:

I've removed global prisma to reproduce this issue..

20240607150531