Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError #16

Closed
heymartinadams opened this issue Sep 30, 2020 · 3 comments · Fixed by #17
Closed

TypeError #16

heymartinadams opened this issue Sep 30, 2020 · 3 comments · Fixed by #17

Comments

@heymartinadams
Copy link

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
Copy link
Owner

Hey @heymartinadams

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

Thanks for reporting!

@martineboh
Copy link

martineboh commented Oct 3, 2020

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
Copy link
Owner

Published in 0.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants