Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)

I have this error when deploy how to fix this
11 Replies
Vero
Vero5mo ago
Hi. That could be happening because the serverless code, in your function, is limited to 1 MB free / 10 MB Paid after compression. You still most of the time don’t want to go over the 1 MB threshold as your Worker gets higher startup times due/slower storage. Try to build the app locally and check the size of your _workers.js if you’re using a framework like next-on-pages which creates one. Also look for dependencies which you are using which can be trimmed. 1 MB is pretty large for a Worker/Function, should be possible to trim some
samerkhusein
samerkhusein5mo ago
i upgraded the plan , but it does not make sense
Vero
Vero5mo ago
Is it working now?
samerkhusein
samerkhusein5mo ago
no
Vero
Vero5mo ago
Are you still getting the same error?
samerkhusein
samerkhusein5mo ago
yes the same error
Vero
Vero5mo ago
Could you please share the build log?
samerkhusein
samerkhusein5mo ago
ok it's working now , but i have the a question how trim worker.js
Vero
Vero5mo ago
You can reduce the size of your function with minification, but probably you're using a framework which is already minifying But in case you need it, here are the docs for esbuild - https://esbuild.github.io/api/#minify
samerkhusein
samerkhusein5mo ago
thank you
Want results from more Discord servers?
Add your server
More Posts