zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
https://zenstack.dev
MIT License
2.05k stars 88 forks source link

Next.js: Module not found: Can't resolve '.zenstack/enhance' #1621

Closed riccardolardi closed 2 months ago

riccardolardi commented 2 months ago

Description and expected behavior When building the Next.js application I get this warning:

./node_modules/@zenstackhq/runtime/enhance.js
Module not found: Can't resolve '.zenstack/enhance' in '/Users/riccardolardi/Code/xyz-nextjs/node_modules/@zenstackhq/runtime'

Import trace for requested module:
./node_modules/@zenstackhq/runtime/enhance.js
./node_modules/@zenstackhq/runtime/index.js
./src/server/api/zen.ts
./src/server/api/trpc.ts
./src/app/api/trpc/[trpc]/route.ts

...upon which the build fails due to lots of eslint errors due to the failed module resolve from above.

Environment (please complete the following information):

Additional context I have tried clearing yarn cache, node_modules, etc. Any help is greatly appreciated.

riccardolardi commented 2 months ago

Nevermind - forgot to run zenstack generate before.