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
Convex Bot
Convex Bot2mo ago
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!
dejeszio
dejeszio2mo ago
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
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
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
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
thats about it
dejeszio
dejeszio2mo ago
what version are you using of the polar sdk
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
one second "@polar-sh/nextjs": "^0.4.2", "@polar-sh/sdk": "^0.34.3", "@convex-dev/polar": "^0.5.0", what do u think?
dejeszio
dejeszio2mo ago
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
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
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?
clar1k
clar1k2mo ago
Try "use node" directive at the top of file I have similar thing with polar too 😄
erquhart
erquhart2mo ago
Going to look at the polar issue today, will reply back here with more.
jamwt
jamwt2mo ago
the one with the action in it that's using more than 64MB of memory
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
I tried nothing changed
jamwt
jamwt2mo ago
it still said "JavaScript execution ran out of memory (maximum memory usage: 64 MB)" ?
Carlos
Carlos2mo ago
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?
erquhart
erquhart2mo ago
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.
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
yess
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)
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)
didnt change
"use node"

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(polar)
app.use(rateLimiter)

export default app
"use node"

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(polar)
app.use(rateLimiter)

export default app
erquhart
erquhart2mo ago
That's your convex.config file, where else are you importing from @convex-dev/polar? You'll want to do it there.
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
i literally have a basic project just this config a schema with a users table clerk connected and functions for users thats it
erquhart
erquhart2mo ago
So you only added polar to the config and haven't used polar anywhere else, right
erquhart
erquhart2mo ago
If you comment out just the line app.use(polar), does it fix?
erquhart
erquhart2mo ago
can you verify the version of @convex-dev/polar you're using
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
"@convex-dev/polar": "^0.5.0",
erquhart
erquhart2mo ago
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
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
I used bun On a nextjs project bunx convex dev
erquhart
erquhart2mo ago
Can you try npm?
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
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
erquhart
erquhart2mo ago
I really don’t know. Others have experienced the same but I haven’t been able to reproduce.
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
it is so weird
Mimameid
Mimameid2mo ago
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?
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
R u using an old project snd u tried adding the component
Mimameid
Mimameid2mo ago
Well, it is a few weeks old but the deps are the latest. Not much going on yet tbh.
Sιɳɠυʅαɾ Sιɳɠυʅαɾιƚყ
Can u try making a new project Then adding the polar component
Mimameid
Mimameid5w ago
Hey, will try. Though setting up a whole new project shouldn't help here at all, no?
erquhart
erquhart4w ago
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.
erquhart
erquhart4w ago
GitHub
JavaScript execution ran out of memory when using Polar Component ...
import polar from &quot;@convex-dev/polar/convex.config&quot; import rateLimiter from &quot;@convex-dev/rate-limiter/convex.config&quot; import { defineApp } from &quot;convex/server&quot; const ap...
erquhart
erquhart4w ago
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.

Did you find this page helpful?