MichalLytek / typegraphql-prisma

Prisma generator to emit TypeGraphQL types and CRUD resolvers from your Prisma schema
https://prisma.typegraphql.com
MIT License
887 stars 113 forks source link

No @generated/type-graphql folder in node_modules #407

Open samerkassem82 opened 1 year ago

samerkassem82 commented 1 year ago

Describe the Bug I have followed your guide https://prisma.typegraphql.com/docs/basics/installation

No @generated/type-graphql folder in node_modules was generated

To Reproduce Following your guide here on node 18.16.0?

Environment (please complete the following information):

{ "devDependencies": { "prisma": "^5.0.0", "typegraphql-prisma": "^0.27.0" }, "scripts": { "preinstall": "nvm install && nvm use" }, "dependencies": { "@apollo/server": "^4.8.1", "@prisma/client": "^5.0.0", "@types/graphql-fields": "^1.3.5", "graphql": "^15.0.0", "graphql-fields": "^2.0.3", "graphql-scalars": "^1.22.2", "tslib": "^2.6.0", "type-graphql": "^1.1.1" } }

Additional Context

image

image

MichalLytek commented 1 year ago

Sorry but unable to reproduce. Please check your schema.prisma file.

image

vleandersson commented 12 months ago

I got the same issue, setting emitTranspiledCode = false does output the generated code correctly but with the transpilation turned on nothing is emitted. Still investigating so will get back here if I find anything else.

Finding 1: The @generated/type-graphql folder is still generated

ivankhm commented 12 months ago

Faced the same issue, but only while building a docker image. Can confirm, that emitTranspiledCode = false fixes my problem.

base is node:18.16-alpine. package versions are: "@prisma/client": "^5.4.2","prisma": "^5.4.2", "reflect-metadata": "^0.1.13", "type-graphql": "2.0.0-beta.3", "typegraphql-prisma": "^0.27.0", "typescript": "5.2.2".

Same setup locally on MacOS it works fine. I'm trying to pin point the difference and create a repo.

vleandersson commented 12 months ago

@ivankhm amazing investigation. If it helps, ts-morph (https://ts-morph.com/setup/) is the package used to emit the transpiled code. What's your node version locally? Thinking this might be some Node issue? 🤔

One thing I've noticed is that it takes a very long time to transpile the code for me (adds maybe 1-2 min vs 10s without transpiling...)

Btw, I'm using pnpm (on MacOS) to run the scripts. What are you using @ivankhm ?

vleandersson commented 11 months ago

@MichalLytek without spending too much time on your end - do you happen to have an example repo I can quickly clone and debug this issue in? 🙏

MichalLytek commented 11 months ago

My debug repo is the experiments folder in this repo - I test there all fixes and develop all the features 😉

vleandersson commented 11 months ago

Brilliant, will have a look and get back to you 🙏