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.07k stars 88 forks source link

[Bug] - Next.js / React Query - `error` type is `unknown` and causes a Typescript error #1062

Closed rcwestlake closed 7 months ago

rcwestlake commented 7 months ago

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

Screenshots Unknown type: image The hook: image Error: image If I switch to a ternary style, it still complains: image

Environment (please complete the following information):

Additional context

ymc9 commented 7 months ago

Thanks for reporting this @rcwestlake ! Yes, we should have better typing for the error. Will make a fix in the next release.

ymc9 commented 7 months ago

Fixes in 1.10.0