Skip to content

CLI crashes when running in an nx monorepo #960

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
ymc9 opened this issue Jan 24, 2024 · 0 comments
Closed

CLI crashes when running in an nx monorepo #960

ymc9 opened this issue Jan 24, 2024 · 0 comments
Milestone

Comments

@ymc9
Copy link
Member

ymc9 commented Jan 24, 2024

Reportd by maxd on discord:

We tried upgrading and had some minor hurdles: we are used to running zenstack generate from within our ./libs/prisma folder of our nx monorepo, which also holds the schema.zmodel. When I try to generate from this directory it now throws an error:

⌛ ZenStack CLI v1.7.0, running plugins

An unexpected error occurred:
 TypeError: Cannot read properties of undefined (reading 'zenstack')
    at getDefaultPrismaOutputFile (/home/max/code/sin/nx-sin/node_modules/zenstack/plugins/prisma/schema-generator.js:346:31)
    at PluginRunner.<anonymous> (/home/max/code/sin/nx-sin/node_modules/zenstack/cli/plugin-runner.js:40:82)
    at Generator.next (<anonymous>)
    at /home/max/code/sin/nx-sin/node_modules/zenstack/cli/plugin-runner.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/max/code/sin/nx-sin/node_modules/zenstack/cli/plugin-runner.js:4:12)
    at PluginRunner.run (/home/max/code/sin/nx-sin/node_modules/zenstack/cli/plugin-runner.js:34:16)
    at /home/max/code/sin/nx-sin/node_modules/zenstack/cli/actions/generate.js:60:54
    at Generator.next (<anonymous>)
    at fulfilled (/home/max/code/sin/nx-sin/node_modules/zenstack/cli/actions/generate.js:5:58)

Moving to the root directory and running the command works correctly: yarn zenstack generate --schema libs/prisma/schema.zmodel

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

1 participant