JavaScript execution ran out of memory (maximum memory usage: 64 MB)
import polar from "@convex-dev/polar/convex.config"
import rateLimiter from "@convex-dev/rate-limiter/convex.config"
import { defineApp } from "convex/server"
const app = defineApp()
app.use(rateLimiter)
app.use(polar)
export default app
getting this error when adding polar component to my config
42 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
are you sure that is why, because that would happen if you are creating too many new variables (like multiple files in binary), or passing too big of a argument into a function
i use this component so just wondering
thats the confusing part
ill show u my code
but im sure cuz only when i comment out polar
then the errors goes
and i dont have any functions aside from users table and its query and mutation



thats about it
what version are you using
of the polar sdk
one second
"@polar-sh/nextjs": "^0.4.2",
"@polar-sh/sdk": "^0.34.3",
"@convex-dev/polar": "^0.5.0",
what do u think?
can you try use "@polar-sh/sdk": "^0.26.1",
i am just curious to see whether it works
if it does, there might be a breaking change in the package
okay one moment
nope still same issue
✖ Error: Unable to start push to https://----.convex.cloud
✖ Error fetching POST https://----.convex.cloud/api/deploy2/start_push 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
error:
JavaScript execution ran out of memory (maximum memory usage: 64 MB)
Any help?
Try "use node" directive at the top of file
I have similar thing with polar too 😄
which file
Going to look at the polar issue today, will reply back here with more.
thank you
the one with the action in it that's using more than 64MB of memory
I tried nothing changed
it still said "JavaScript execution ran out of memory (maximum memory usage: 64 MB)" ?
Hey since we are discussing the Polar component, is it safe to assume it's mostly tailored to monthly subscription services and in the event I also want to add a PAYG option, a different SDK integration would be better instead?
For now monthly and yearly is the primary target, but I don't think that blocks pay as you go, might just limit how much of the component is useful for you.
As Jamie said, there should at minimum be a change in the error message, even if it still fails, as the node runtime has a higher max memory than 64mb.
Folks have sort of run into this at random with the Polar component, no one has been able to pin down how to repro yet.
yess
didnt change
That's your convex.config file, where else are you importing from @convex-dev/polar? You'll want to do it there.
i literally have a basic project
just this config
a schema with a users table
clerk connected
and functions for users
thats it
So you only added polar to the config and haven't used polar anywhere else, right
yes
If you comment out just the line
app.use(polar)
, does it fix?yep
can you verify the version of @convex-dev/polar you're using
"@convex-dev/polar": "^0.5.0",
Alright, trying with a fresh project now
Not seeing this. Need to figure out what part of your project is different from a regular project started with
npm create convex
I used bun
On a nextjs project
bunx convex dev
Can you try npm?
im trying rn one moment
ok i was testing a new project again
using bun again
and for some reason
the same code worked
like same convex configuration
same everything
what could be the reason
I really don’t know. Others have experienced the same but I haven’t been able to reproduce.
it is so weird
Running into this right now...It is a blocker. @Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ do you have a temporary fix or so for this? Or is the component just not usable right now?
R u using an old project snd u tried adding the component
Well, it is a few weeks old but the deps are the latest.
Not much going on yet tbh.
Can u try making a new project
Then adding the polar component
Hey, will try. Though setting up a whole new project shouldn't help here at all, no?
I suspect this will be something folks randomly run into due to the size of the polar sdk. There's an alternative for serverless environments that I need to look into to get around this.
You can track here: https://github.com/get-convex/polar/issues/11#issuecomment-3109612002
GitHub
JavaScript execution ran out of memory when using Polar Component ...
import polar from "@convex-dev/polar/convex.config" import rateLimiter from "@convex-dev/rate-limiter/convex.config" import { defineApp } from "convex/server" const ap...
0.6.0 published, drops unpacked size from 25mb to 0.5mb - not sure how much the unpacked is supposed to affect the bundle anyway, but it's small now.