-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Generated "enhance" function not found. Please run zenstack generate first. #1983
Comments
Hi @Izag-Larm , just to confirm, do you have any regex validation patterns in the ZModel? We recently discovered an issue that invalid regex patterns can cause the "enhance function not found" error. |
@ymc9 I am also having this issue. I'm using regex in the zmodel, but the regex appears fine to me, and the same error happens when I remove the regex.
Interestingly, the error only happens when I run my app with I know you can't do much without a repro, so I'll see if I can set one up and open another issue if need be. |
I don't have any regex validation pattern in my zmodel. |
I am having the same issue in [email protected]. All works well in dev but once built, the following happens: Somehow, when I downgrade from node@22 to node@20, it works perfectly fine. |
Thanks for the comments. Does anyone have a sharable repro project? |
Yup, https://github.com/Kylyi/nuxt-zenstack. Just make sure to use node@22. |
This is actually starting to be a bigger issue as it somehow breaks in docker as well in some cases, even when using node@20. WIll ty to prepare another repro. |
Had same issue with zenstack v2.12.1 node v23 ando v22. Using node v18 fixed it. |
I just encountered this issue going from node 20.18.3 to 20.19.0. Using the flag
|
I made a few tries with node 20.19.0 as @sslotnick indicated:
So it seems later node versions broke something related loading ESM with I don't have further insight into the issue so far, and please use @sslotnick 's workaround for now. |
Description and expected behavior
I started the development of a Nuxt application and after defining my zenstack schema, I wrote an API route for the server to retrieve a file entity from the database. But I get an error after having at the execution level of enhance(prisma). However I have already run
npx zenstack generate
andnpx prisma db push
.Screenshots
zmodel
global prisma client
route api
Environment (please complete the following information):
Additional context
I running nuxt with compatibility version 4
The text was updated successfully, but these errors were encountered: