zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

Broken reference/return type of `enhance` missing after running `zenstack generate`

Open mloffer opened this issue 5 months ago • 1 comments

Description and expected behavior

  1. Create a sample Turborepo project using the "with-prisma" example, instructions here. i.e. pnpm dlx create-turbo@latest --example with-prisma. Be sure to select pnpm for the package manager.
  2. Run pnpm dlx zenstack@latest init from the packages/database workspace to add zenstack.
  3. Modify packages/database/src/client.ts to export PrismaClient from prisma and everything from zenstack.
  4. Modify apps/web/src/app/page.tsx to create an enhanced database client by consuming @repo/database.
  5. Observe the return type of enhance to be any. Navigating to declaration shows the module is missing.

Reproduction can be found here. Note that the runtime executes successfully. However, no typing information is available to IDEs.

Screenshots image image

Environment (please complete the following information):

  • ZenStack version: 2.4.1
  • Prisma version: 5.10.2
  • Database type: Postgresql

Additional context

  • Windows 11 23H2
  • Node v22.8.0
  • pnpm v9.9.0
  • Webstorm 2024.2.1

mloffer avatar Sep 05 '24 23:09 mloffer