prisma: Error: spawn E2BIG
Trying to run prisma2 generate
(preview-3
) on an 18MB model file results in Error: spawn E2BIG
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 32 (16 by maintainers)
Commits related to this issue
- fix #254: E2BIG — committed to jednano/prisma2 by jednano 5 years ago
- fix #254: E2BIG — committed to jednano/prisma2 by jednano 5 years ago
- fix #254: E2BIG — committed to jednano/prisma2 by jednano 5 years ago
- fix #254: E2BIG (#907) — committed to prisma/prisma by jedmao 5 years ago
- Closes prisma/prisma2#254 Former-commit-id: dcda90c55c12ca50887a43625427ce093e7225e0 — committed to prisma/prisma by timsuchanek 5 years ago
- Closes prisma/prisma2#254 Former-commit-id: dcda90c55c12ca50887a43625427ce093e7225e0 Former-commit-id: 9679185f6aea057f1988cc2cfd89a0c7cac7e1b2 — committed to prisma/prisma by timsuchanek 5 years ago
We just had a discussion about this issue, we have to push it back a few weeks (3-4) to solve it properly after https://github.com/prisma/photonjs/issues/238 (a lot of related changes) is implemented.
However, to temporarily unblock people, we can do #621, which I already raised for the next sprint 🙏
Please bear with us on this one, it is a high priority for us and on our mind, we are working towards fixing this every sprint 🙌
@timsuchanek I can confirm that its working for me now. Thank you so much for dealing with this.
2.0.0-preview016 fixed this error for me
Tried to use this on our existing DB and unfortunately it won’t work. Hopefully we can get it soon.
We did some research on this and it turns out, that for a schema with 1000 models, we generate 500k lines of code with a file size of 30mb. The TypeScript compiler is not able to handle the compilation of that and crashes.
Next steps:
@generated/photon/index.js
and@generated/photon/index.d.ts
without the TypeScript compilerPlease make this a priority! This is a major blocker when trying to transition from prisma1 to prisma2
Just chiming in. This is a must-have for our team.
I have a sample reproduction here to hopefully help track this down: https://github.com/thortek/prisma2-issue254-reproduction
Thanks a lot for providing this additional information. We’ll be looking into it!
I’m receiving the same error message. We have 400+ Postgres tables. I was following the tutorial:
prisma2 init
, which generated theschema.prisma
file based on those tables. The file size is only 268 KB.prisma2 generate
to generate the photon clientReceived error message:
Update: In https://github.com/prisma/prisma2/releases/tag/2.0.0-preview016.2 we pushed the limits a bit further again - a schema with 3000 models is now working. The next (and last) big leap to get to even bigger schemas is an optimization to the Photon generator code.
We have a new alpha out, which already fixes it for schemas of the size of 1000 models. It seems like schemas with 10000 models are not yet working. We’ll investigate and do a fix soon!
@Manouli it’ll take still a bit until it’s out, the CI pipeline is stuck. I’ll ping you once it’s out!
In the next sprint we will investigate, which concrete bugs are happening.
BTW, with the exact same setup I described yesterday except that I updated to preview5, I get the following more detailed error:
I am trying to create a GraphQL wrapper for an industry standard database: https://github.com/rbhughes/pg_ppdm