omar-dulaimi / prisma-yup-generator

Prisma 2+ generator to emit Yup schemas from your Prisma schema
MIT License
53 stars 3 forks source link

error - ReferenceError: Cannot access 'AccountWhereInputObjectSchema' before initialization #9

Closed felixerdy closed 2 years ago

felixerdy commented 2 years ago

Bug description

I'm getting the following error with v0.1.4:

error - ReferenceError: Cannot access 'AccountWhereInputObjectSchema' before initialization

How to reproduce

having the following code in the api:

await GameCreateSchema.validate({
    ...body,
    userId,
})

Expected behavior

No response

Prisma information

see #6

Environment & setup

see #6

Prisma Version

prisma                  : 3.15.1
@prisma/client          : 3.15.1
Current platform        : darwin-arm64
Query Engine (Node-API) : libquery-engine 461d6a05159055555eb7dfb337c9fb271cbd4d7e (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Migration Engine        : migration-engine-cli 461d6a05159055555eb7dfb337c9fb271cbd4d7e (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
Introspection Engine    : introspection-core 461d6a05159055555eb7dfb337c9fb271cbd4d7e (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
Format Binary           : prisma-fmt 461d6a05159055555eb7dfb337c9fb271cbd4d7e (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
Default Engines Hash    : 461d6a05159055555eb7dfb337c9fb271cbd4d7e
Studio                  : 0.462.0
omar-dulaimi commented 2 years ago

@felixerdy Sorry for the delay. I have been busy lately. I'll try to work on this soon.

omar-dulaimi commented 2 years ago

@felixerdy

I have just made a release 0.1.5.

Please give it a try and let me know if it solves your issue.

Also, GameCreateSchema takes a data key, so make sure to enter your data correctly.

omar-dulaimi commented 2 years ago

Please open a new issue if you face any problems.