zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

Wrong import path when outputing prisma client to the same zenstack output location

Open Tsimopak opened this issue 1 year ago • 0 comments

In my schema.zmodel I define to output the prisma client to the same dir with zenstack:

generator client {
  provider = "prisma-client-js"
  output = '../../lib/zenstack/prisma'
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

plugin enhancer {
  provider = '@core/enhancer'
  output = '../lib/zenstack'
  compile = false
}

But I get errors in in the various files, e.g. in policy.ts that the types there are not imported correctly, when I opened the file I noticed that the import looks as follows:

import { UserState } from "prisma";

Instead of:

import { UserState } from './prisma

Zenstack: 2.5.1 Prisma: 5.19.1

Tsimopak avatar Sep 26 '24 08:09 Tsimopak