k9 - Is it expected that Zod would cause such a...
Is it expected that Zod would cause such a spike in build memory consumption?
This is an interesting one. I've been able to deploy to Heroku for years. Now Heroku won't build my application because the Typescript compiler runs out of memory. The only meaningful change I can think of is introducing Zod. I deploy once every few days, so it might not be the case.
Heroku configuration seems to use the same environment variables for compilation and deployment, (Wow do I have security questions about that one.) The important thing is that our runtime app caps memory at 350:
NODE_OPTIONS=--max-old-space-size=350
. But now the compilation phase dies with this error:
I compiled locally setting the environment variable a number of different values and found that roughly --max-old-size=400
would do the trick. But should Zod actually consume that much memory?6 Replies
I wonder if this is just an incremental increase, but I still can't believe the same environment variables are used during the build and runtime steps.
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
it makes me wonder whether I should abandon Zod if that's going to be an ongoing issue.
Thank you
That's going to be my approach for now
(too bad)
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Thanks, @gtflip
Type inference can be expensive for the typescript compiler and 5.4 fixed a type bug at the cost of much higher instantiations so it could be something like that.