-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
tsc --watch
fails with JavaScript heap out of memory
error
#20308
Comments
tsc --watch
failes with tsc --watch
failes with JavaScript heap out of memory
error
Same |
👍 - I have also noticed the same error. For us, it started happening after we upgraded prisma |
@justinsmid My commercial project also has the 6K LOC prisma schema definition (TS is 100K). But in my case, I cannot avoid the bug even when assigning 16GB memory. Therefore, I also downgraded to 4 version. Is there someone who can provide reproducible repo? |
Same behaviour while using prisma client extensions. TypeScript v5.1.6 |
Hey @samchon @liqMats @justinsmid @GitMarijn thanks for the report. Could you please provide us access to a small reproduction or directly to you repository. We can sign an NDA if needed for you to keep things private, and/or you can contact me via DM on our public Slack or Discord. Also, which of you is using client extensions, and who is not? |
tsc --watch
failes with JavaScript heap out of memory
errortsc --watch
fails with JavaScript heap out of memory
error
This may be a long-shot, but do you have the We were also using the single pattern in our prisma declaration file -- commenting out all the info relating to /*
* this is the file where I declare the global singleton for prisma
* this is part of next.js (13) project
*/
import { PrismaClient } from "@prisma/client";
// declare global {
// // eslint-disable-next-line no-var
// var prisma: PrismaClient | undefined;
// }
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV !== "production") global.prisma = prisma;
export default prisma; |
@phil-loops are you using client extensions? |
@millsp no, in this repo we were initializing prisma with For me, the Also, I noted when I deleted |
Steps to reproduce:
For me, the last time running the command (during the compiling step), I hit the fatal memory error. Fwiw we also have a sizable prisma file (we have 40 models and 5 enums defined in our schema). For now, I think we're going to delete the artifact file and set |
Thanks for the info. We also have some huge schemas at hand, so I could try with that and get back to you. If I cannot reproduce, I'll need your help again :) |
Does 4.16 work well for you? |
Ah, nice point. 4.16.0 seems to be okay. However, 4.16.1 seems to be where the behavior was introduced. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Upgrading from 4.12.0 to 5.0.0 and I've started getting
|
Thanks for the report @revmischa. Could you please give me access to the repo so that I can reproduce this? Update: We've received a reproduction. |
Since I had two reports via DM that this is fixed on our Thanks all of you. |
I am on Prisma version 5.3 and client 5.3, and I am Still getting this error this is happening on my Mac with 16 GB RAM |
Hey @peterarusanoff 👋 I'd appreciate if you could create a new issue for us with the necessary info for us to reproduce it. Thanks! |
Bug description
When run
tsc --watch
command and edit some codes using prisma, about two minutes being consumed, and such error being occurred. For reference, such bug does not occur when running onlytsc
command. Also, does not occur intsc --watch
command until do update, either.tsc
: works finetsc --watch
and do not anything: works finetsc --watch
and update something: errorI also tried to avoid the bug by assigning much more memory, but same bug still occurs, and needed much more minutes to get the same error message.
node --max-old-space-size=4096 node_modules/typescript/bin/tsc --watch
How to reproduce
I don't know how to reproduce it.
Such bug had not occurred when project is small, but started being happened when project being larger.
As this project is commercial project that is not opened public, I'm sorry to cannot share with you.
If a reproducible repo must be, I'll try it next month \o/.
Expected behavior
No problem when running
tsc --watch
and updating source code.Prisma information
Sorry for cannot write prisma schema content due to commercial project.
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: