zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

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

Open Siykt opened this issue 1 year ago • 2 comments

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):

  • ZenStack version: 2.1.2
  • @zenstackhq/openapi: 2.1.2
  • Prisma version: 5.12.1

Siykt avatar Jun 06 '24 08:06 Siykt

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.

ymc9 avatar Jun 07 '24 02:06 ymc9

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

Siykt avatar Jun 07 '24 07:06 Siykt