Skip to content

Using @zenstackhq/server when zenstack is configured to output to a different location #2094

@dennispg

Description

@dennispg

Description and expected behavior
I am outputing zenstack generate to a custom location instead of into node_modules. When I use @zenstackhq/server/next I get this:

../../node_modules/.pnpm/@zenstackhq+runtime@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/runtime/enhance.js
Module not found: Can't resolve '.zenstack/enhance' in '../../node_modules/.pnpm/@zenstackhq+runtime@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/runtime'

Import trace for requested module:
../../node_modules/.pnpm/@zenstackhq+runtime@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/runtime/enhance.js
../../node_modules/.pnpm/@zenstackhq+runtime@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/runtime/index.js
../../node_modules/.pnpm/@zenstackhq+server@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/server/api/rpc/index.js
../../node_modules/.pnpm/@zenstackhq+server@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/server/api/index.js
../../node_modules/.pnpm/@zenstackhq+server@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/server/next/app-route-handler.js
../../node_modules/.pnpm/@zenstackhq+server@2.14.0_@prisma+client@6.6.0_prisma@6.6.0_typescript@5.8.3__typescript@5.8.3_/node_modules/@zenstackhq/server/next/index.js

  • ZenStack version: 2.14.0
  • Prisma version: 6.6.0
  • Database type: Postgresql

Additional context
Using turborepo, next 14, no turbopack.

Prisma and zenstack are in a separate package, and the generated output is in that other package.

I tried to make a repro project using next 15 with turbopack and I didn't see the same error. How do I configure the server package to know where to find the output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions