zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

Lack of zmodel schema error warnings

Open eleazareramos opened this issue 10 months ago • 2 comments

Description and expected behavior A clear and concise description of what the bug is and what's the expected behavior.

Twice, I've run into scenarios where I had an error in schema.zmodel but it was unknown to me after a successful zenstack generate without any warnings (nor in the IDE tool).

  1. For a @@validate attribute, I used status == DONE as opposed to status == "DONE" (where DONE is one of the status enums)
  2. I had a slight regex error in a data-level validation attribute.

No errors come up in the generate & push process. Then, only at runtime do I get an error related to .zenstack/models not having a valid export with no indication that it is related to errors in the schema.zmodel.

Please catch & flag these errors somewhere in the generation process so it's not a game of wack a mole :)

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • ZenStack version: 2.11.6
  • Prisma version: 6.3.x
  • Database type: Postgres

Additional context Add any other context about the problem here.

eleazareramos avatar Feb 12 '25 14:02 eleazareramos

Hi @eleazareramos , thanks for filing this. Could you share more details about "I had a slight regex error in a data-level validation attribute."? Thanks!

ymc9 avatar Feb 16 '25 18:02 ymc9

Hi @ymc9 ! I no longer have the exact value, but it was a syntax issue where i missed closing a parenthesis! (an input which would throw an error on new RegExp() – but nothing was called out in the generate / build process!)

eleazareramos avatar Feb 22 '25 19:02 eleazareramos

Closing for now and will reopen when a repro is available.

ymc9 avatar Jun 03 '25 16:06 ymc9