-
-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
Description and expected behavior
I got an exception of Generated "enhance" function not found. Please run zenstack generate
first. even though i did zenstack generate.
Steps to reproduce:
- mkdir new folder
- npm init -y
- npm i -D typescript
- npx tsc --init
- npx zenstack init
- npx zenstack generate && npx prisma db push
- make an index.ts file with:
import { PrismaClient } from '@prisma/client';
import { enhance } from '@zenstackhq/runtime';
const prisma = new PrismaClient();
const db = enhance(
prisma,
{
},
{
kinds: ['delegate', 'policy'],
}
);
- npx tsx ./index.ts
Environment (please complete the following information):
"devDependencies": {
"prisma": "6.8.x",
"typescript": "^5.8.3",
"zenstack": "2.15.1"
},
"dependencies": {
"@prisma/client": "6.8.x",
"@zenstackhq/runtime": "2.15.1"
}
I tried both with postgresql and sqlite
EDIT: I think that it seems to be an issue with tsx
library, because when i do npx tsc index.ts
and then run node index.js
it works.
Metadata
Metadata
Assignees
Labels
No labels