Skip to content

Error: Value must be boolean #2038

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

Closed
baenio opened this issue Mar 11, 2025 · 3 comments
Closed

Error: Value must be boolean #2038

baenio opened this issue Mar 11, 2025 · 3 comments

Comments

@baenio
Copy link

baenio commented Mar 11, 2025

Description and expected behavior
After upgrading ZenStack from version 2.11.1 to 2.12.2, I encountered an error when running npx zenstack generate.

Error

An unexpected error occurred:
 Error: Value must be boolean
    at new AttributeArgValue (<project_path>/node_modules/zenstack/plugins/prisma/prisma-builder.js:224:27)
    at <project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:622:36
    at e.run (<project_path>/node_modules/ts-pattern/dist/index.cjs:1:4927)
    at e.otherwise (<project_path>/node_modules/ts-pattern/dist/index.cjs:1:4570)
    at PrismaSchemaGenerator.setDummyDefault (<project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:626:14)
    at PrismaSchemaGenerator.generateModelField (<project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:613:22)
    at PrismaSchemaGenerator.generateModel (<project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:207:22)
    at PrismaSchemaGenerator.<anonymous> (<project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:87:30)
    at Generator.next (<anonymous>)
    at <project_path>/node_modules/zenstack/plugins/prisma/schema-generator.js:8:71

Environment

  • ZenStack version: 2.12.2
  • Prisma version: 5.22.0
  • Database type: PostgreSQL
@ymc9
Copy link
Member

ymc9 commented Mar 11, 2025

Hi @baenio , thanks filing this. I think it's caused by a specific attribute. Do you have a minimal sharable ZModel file?

@baenio
Copy link
Author

baenio commented Mar 14, 2025

Hey @ymc9! It's rather a big project. Can you specify, what is needed?

Here is the base schema.zmodel, without any models

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "darwin-arm64", "rhel-openssl-1.0.x"]
  previewFeatures = ["omitApi","postgresqlExtensions","views"]
}

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
  extensions = [pgcrypto]
}

plugin hooks {
  provider = "@zenstackhq/swr"
  output   = "../hooks/zenstack"
}

@ymc9
Copy link
Member

ymc9 commented Mar 21, 2025

I think I know where the problem is now. Will make a fix soon @baenio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants