You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I got this error when I'm using the React lplugin:
npx zenstack generate
⌛️ ZenStack CLI v1.0.0-alpha.79, running plugins
⠋ Running plugin PrismaEnvironment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
✔ Generated Prisma Client (4.11.0 | library) to .\node_modules\@prisma\client in 281ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
✔ Running plugin Prisma
✔ Running plugin Model Metadata
✔ Running plugin Access Policy
✖ Running plugin React
An unexpected error occurred:
TypeError: Cannot read properties of undefined (reading 'updateOne')
at generateModelHooks (D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:232:87)
at D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:57:13
at Array.forEach (<anonymous>)
at D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:55:16
at Generator.next (<anonymous>)
at D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:31:71
at new Promise (<anonymous>)
at __awaiter (D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:27:12)
at generate (D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\react-hooks-generator.js:42:12)
at D:\Coding\Web\DigitalNomading\node_modules\@zenstackhq\react\index.js:17:53
I just checked the code and I think you just need to add a "?" in https://github.com/zenstackhq/zenstack/blob/main/packages/plugins/react/src/react-hooks-generator.ts
Change if (mapping?.update || (mapping as any).updateOne) {
To if (mapping?.update || (mapping as any)?.updateOne) {
(Sorry, too lazy do to a PR...)
The text was updated successfully, but these errors were encountered:
Thanks again for filing this! I've made a fix to consistently deal with models marked @@ignore. Please update "zenstack" and "@zenstackhq/*" packages to "@latest" (version 1.0.0-alpha.81) and it should work now.
Hello, I got this error when I'm using the React lplugin:
I just checked the code and I think you just need to add a "?" in
https://github.com/zenstackhq/zenstack/blob/main/packages/plugins/react/src/react-hooks-generator.ts
Change
if (mapping?.update || (mapping as any).updateOne) {
To
if (mapping?.update || (mapping as any)?.updateOne) {
(Sorry, too lazy do to a PR...)
The text was updated successfully, but these errors were encountered: