Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate sources throw error when using importsNotUsedAsValues tsconfig opion #96

Closed
juh9870 opened this issue Mar 5, 2023 · 4 comments

Comments

@juh9870
Copy link

juh9870 commented Mar 5, 2023

when "importsNotUsedAsValues": "error", generated sources throw an error, because they use import { type Prisma } from '@prisma/client'; instead of import type { Prisma } from '@prisma/client';

@chrishoermann
Copy link
Owner

@juh9870 I don't know what you mean by "they use import { type Prisma } from '@prisma/client';"?

The generator should generate import type { Prisma } from '@prisma/client';. Is this not the case on your end?

@juh9870
Copy link
Author

juh9870 commented Mar 6, 2023

Yes, it generates import { type...
Have just updated to 2.3.5, and problem still remains.
My prisma config:

generator zod {
  provider                  = "zod-prisma-types"
  createRelationValuesTypes = true
}

Full project: https://github.com/juh9870/library-backend

chrishoermann added a commit that referenced this issue Mar 7, 2023
@chrishoermann
Copy link
Owner

@juh9870 sorry my bad. had some code fragments where the described import was used. should be fixed in the latest version.

@juh9870
Copy link
Author

juh9870 commented Mar 9, 2023

Issue still remains, I use single file generation, so this line is problematic:

writeImport(`{ type Prisma }`, `${prismaClientPath}`);

chrishoermann added a commit that referenced this issue Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants