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

Warning during generate since 2.9.0: Could not resolve PrismaClient type declaration path. This may break plugins that depend on it. #1875

Closed
marekryb opened this issue Nov 19, 2024 · 13 comments

Comments

@marekryb
Copy link

Description and expected behavior
Since upgrading to version 2.9.0, I am having a warning during zenstack generate command.

⠋ Generating Prisma schemaCould not resolve PrismaClient type declaration path. This may break plugins that depend on it.
✔ Generating Prisma schema
✔ Generating PrismaClient enhancer

This happens only in monorepo setup. I initially tried to reproduce in 'plain' repo, but could not.
It is probably related to the fact that I specify custom prisma output directory.

Repro repo: https://github.com/marekryb/zenstack-290-warning

Environment (please complete the following information):

  • ZenStack version: 2.9.0
  • Prisma version: 5.22.0
  • Database type: any (tried sqlite and postgres)

Additional context
I am using pnpm. Did not try with npm or yarn workspaces.

@ymc9
Copy link
Member

ymc9 commented Nov 19, 2024

Hi @marekryb , thanks for reporting this. I'll look into it.

@ymc9
Copy link
Member

ymc9 commented Nov 19, 2024

Fixed in 2.9.1

@ymc9 ymc9 closed this as completed Nov 19, 2024
@tony-cocco
Copy link

Came here after hitting this error and having just upgraded to 2.9.1. Was still having the issue but was able to fix it by adding an output dir.

Before:

generator client {
  provider = "prisma-client-js"
}

After:

generator client {
  provider = "prisma-client-js"
  output = "./generated"
}

@ymc9
Copy link
Member

ymc9 commented Nov 21, 2024

Came here after hitting this error and having just upgraded to 2.9.1. Was still having the issue but was able to fix it by adding an output dir.

Before:

generator client {
  provider = "prisma-client-js"
}

After:

generator client {
  provider = "prisma-client-js"
  output = "./generated"
}

Hi @tony-cocco , is it a pnpm monorepo?

@ymc9 ymc9 reopened this Nov 21, 2024
@tony-cocco
Copy link

tony-cocco commented Nov 21, 2024

Hi @ymc9 - yes. I tried to compare with the sample repo in the original post but it's currently a 404 for me. Happy to provide any other config we are using.

@ymc9
Copy link
Member

ymc9 commented Nov 22, 2024

Hi @ymc9 - yes. I tried to compare with the sample repo in the original post but it's currently a 404 for me. Happy to provide any other config we are using.

Got it. I think I know what's going on. Will make a 2.9.2 fix.

@sourcebert
Copy link

sourcebert commented Nov 22, 2024

Same warning/error here:

  • ZenStack 2.9.1
  • pnpm (no monorepo)
  • Prisma without custom output directory
⌛️ ZenStack CLI v2.9.1, running plugins
⠋ Generating Prisma schemaCould not resolve PrismaClient type declaration path. This may break plugins that depend on it.
✔ Generating Prisma schema
✔ Generating PrismaClient enhancer

👻 All plugins completed successfully!
Failed to format Prisma schema file
Don't forget to restart your dev server to let the changes take effect.

Generated Prisma file seems fine and the enhanced zenstack client works without issues.

@ymc9
Copy link
Member

ymc9 commented Nov 22, 2024

Hello guys, could you try if you still have the warning with the new 2.9.2 release?

@tony-cocco
Copy link

Hello guys, could you try if you still have the warning with the new 2.9.2 release?

Change snippet:

   zenstack:
-    "@zenstackhq/runtime": 2.8.1
-    "@zenstackhq/tanstack-query": 2.8.1
-    "@zenstackhq/server": 2.8.1
-    zenstack: 2.8.1
+    "@zenstackhq/runtime": 2.9.2
+    "@zenstackhq/tanstack-query": 2.9.2
+    "@zenstackhq/server": 2.9.2
+    zenstack: 2.9.2

I was also interested in using the new portable flag for the hooks plugin and added that as well.

I do NOT have the warning. My build also seems to be back to stable unlike the 2.9.1 version. I want to say 2.9.2 fixed everything for me. ❤️

@ymc9
Copy link
Member

ymc9 commented Nov 22, 2024

Thank you for the confirmation @tony-cocco !

@sourcebert
Copy link

I can also confirm that the warning is no longer displayed with the new version. Thank you so much for the quick fix! 🎉

The only warning that remains is:

Failed to format Prisma schema file

However, this is probably a separate issue... 😅

@ymc9
Copy link
Member

ymc9 commented Nov 22, 2024

I can also confirm that the warning is no longer displayed with the new version. Thank you so much for the quick fix! 🎉

The only warning that remains is:

Failed to format Prisma schema file

However, this is probably a separate issue... 😅

Yes, likely a separate issue ... do you have a sharable repro?

@ymc9
Copy link
Member

ymc9 commented Nov 27, 2024

I'm closing it for now since the original issue is resolved. Please help create separate issues as needed. Thanks!

@ymc9 ymc9 closed this as completed Nov 27, 2024
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

4 participants