question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prisma generate is unable to generate typegraphql

See original GitHub issue

Bug description

I am running a docker container with node:14-alpine on my Mac. The npx prisma generate command used to work fine before.

After I witched from 2.25.0 to 3.2.1 the generate command stopped working, although this may not be the issue. I get this now :

Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma Error: ✔ Generated Prisma Client (3.2.1) to ./node_modules/@prisma/client in 718ms

Error: EIO: i/o error, open '/app/node_modules/@generated/type-graphql/resolvers/crud/model/FindFirstModelResolver.js

During this time, I added more models to the schema and my schema is around 700 lines.

The error changes each time I run the generate command. I suspect the large number of files created during the generation to be the issue. I can see the files in the @generated folder, but most of those are blank.

When I run the same container on an ubuntu machine, I get the too many files error.

How to reproduce

  1. run npx prisma generate
  2. the typegraphql generation gives an error

Expected behavior

No response

Prisma information

schema is around 700 lines.

Environment & setup

  • OS: Mac OS
  • Database: PostgreSQL
  • Node.js version: docker node:14-alpine

Prisma Version

prisma                  : 3.2.1
@prisma/client          : 3.2.1
Current platform        : linux-musl
Query Engine (Node-API) : libquery-engine b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at node_modules/prisma/node_modules/@prisma/engines/libquery_engine-linux-musl.so.node)
Migration Engine        : migration-engine-cli b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at node_modules/prisma/node_modules/@prisma/engines/migration-engine-linux-musl)
Introspection Engine    : introspection-core b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at node_modules/prisma/node_modules/@prisma/engines/introspection-engine-linux-musl)
Format Binary           : prisma-fmt b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c (at node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-linux-musl)
Default Engines Hash    : b71d8cb16c4ddc7e3e9821f42fd09b0f82d7934c
Studio                  : 0.435.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sagarsnehcommented, Nov 11, 2021

Thanks @janpio, I think the issue is with typegraphql-prisma. But I will try and find out if this works with the older prisma.

0reactions
janconccommented, Nov 12, 2021

I use typegraphql-prisma as well, although my Prisma schema is smaller than yours (~250 lines, 22 models). This sounds like some problem in your environment/OS/filesystem. I don’t have a mac, I am running it on 1 year old version of WSL2… Note, that typegraphql-prisma generates lot of stuff and the library from version 0.16.2 can limit the amount of generated (potentially never used) stuff. Try to consider if you can limit the generated files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typegraphql-prisma: Unable to infer GraphQL type from ...
Use npx prisma migrate dev This command generates the Prisma client that will include the latest changes and also updated typegraphql ...
Read more >
Prisma Integration - TypeGraphQL
TypeGraphQL provides an integration with Prisma by the typegraphql-prisma package. It generates the type classes and CRUD resolvers based on the Prisma ......
Read more >
Autocompletion in GraphQL resolvers with JavaScript - Prisma
Learn how you can get autocompletion for Prisma Client queries in GraphQL ... can be typed – no matter if folks are using...
Read more >
typegraphql-prisma - npm
Start using typegraphql-prisma in your project by running `npm i ... Prisma generator to emit TypeGraphQL types and CRUD resolvers from your Prisma...
Read more >
type-graphql/prisma2 - Gitter
yarn prisma generate. I get this error: Error: EROFS: read-only filesystem, open '/node_modules/@prisma/engines/prisma-fmt-darwin'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found