pantharshit00 / prisma-docs-generator

Prisma generator for automatically generating documentation reference from the Prisma schema.
MIT License
578 stars 27 forks source link

TypeError #16

Closed heymartinadams closed 4 years ago

heymartinadams commented 4 years ago

Hi @pantharshit00 since upgrading to latest Prisma, I’m getting the following error:

TypeError: Cannot read property 'type' of undefinedat /__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:393:47
    at Array.map (<anonymous>)
    at /__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:391:90
    at Array.forEach (<anonymous>)
    at ModelGenerator.getModelOperations (/__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:267:18)
    at /__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:506:34
    at Array.map (<anonymous>)
    at ModelGenerator.getModels (/__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:500:38)
    at ModelGenerator.getData (/__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:512:26)
    at new ModelGenerator (/__PATH__/node_modules/prisma-docs-generator/dist/generator/model.js:35:26)

Removing prisma-docs-generator fixed the error, obviously, but it also means I can’t use it. Really hope your Prisma Docs Generator makes it into production at Prisma!

pantharshit00 commented 4 years ago

Hey @heymartinadams

I will fix this over the weekend and make a new release :).

Thanks for reporting!

martineboh commented 4 years ago

Hey @pantharshit00 , I am also getting this error after upgrading to Prisma 2.8.0:


PS C:\fode\mtchero\prisma> npm run generate

> prisma@ generate C:\fode\mtchero\prisma
> cross-env CHECKPOINT_DISABLE=1 DEBUG=prisma-client,engine npx prisma generate --schema=schema.prisma

Environment variables loaded from provided --schema directory
Prisma Schema loaded from schema.prisma
Error: 
✔ Generated Prisma Client (version: 2.8.0) to .\..\node_modules\@prisma\client in 6.35s

TypeError: Cannot read property 'type' of undefined
    at C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:393:47
    at Array.map (<anonymous>)
    at C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:391:90
    at Array.forEach (<anonymous>)
    at ModelGenerator.getModelOperations (C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:267:18)
    at C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:506:34
    at Array.map (<anonymous>)
    at ModelGenerator.getModels (C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:500:38)
    at ModelGenerator.getData (C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:512:26)
    at new ModelGenerator (C:\fode\mtchero\node_modules\prisma-docs-generator\dist\generator\model.js:35:26)

✔ Generated DBML Schema to .\dbml in 640ms

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! prisma@ generate: `cross-env CHECKPOINT_DISABLE=1 DEBUG=prisma-client,engine npx prisma generate --schema=schema.prisma`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the prisma@ generate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
`
Hope to apply your fix this weekend. 

Thanks for this amazing and valuable tool.
pantharshit00 commented 4 years ago

Published in 0.0.6