You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Run pnpm dlx zenstack@latest init from the packages/database workspace to add zenstack.
Modify packages/database/src/client.ts to export PrismaClient from prisma and everything from zenstack.
Modify apps/web/src/app/page.tsx to create an enhanced database client by consuming @repo/database.
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
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
The text was updated successfully, but these errors were encountered:
The same behavior is exhibited using yarn v1 in place of pnpm.
Similar behavior is exhibited for npm: specifically, the "old state" persists, i.e. no new models show up and removed models are still present.
Both IDEs can resolve the references properly if you close and restart them (note: this is not a viable workaround)
In contrast to ZenStack's enhance, PrismaClient has the proper types resolved every time generate is run (maybe Prisma can provide a clue for a fix?)
mloffer
changed the title
Broken reference/return type of enhance missing under pnpm
Broken reference/return type of enhance missing after running generateSep 6, 2024
mloffer
changed the title
Broken reference/return type of enhance missing after running generate
Broken reference/return type of enhance missing after running zenstack generateSep 6, 2024
Description and expected behavior
pnpm dlx create-turbo@latest --example with-prisma
. Be sure to select pnpm for the package manager.pnpm dlx zenstack@latest init
from thepackages/database
workspace to add zenstack.packages/database/src/client.ts
to export PrismaClient from prisma and everything from zenstack.apps/web/src/app/page.tsx
to create an enhanced database client by consuming @repo/database.enhance
to beany
. 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
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: