Your worker exceeded 1mb

Error: Failed to publish your Function. Got error: Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation (https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more details.
Error: Failed to publish your Function. Got error: Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation (https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more details.
How do I check this? Can I build it locally and check somehow if it is reaching 1MB? How can I check it locally on my machine? And what exactly is it talking about by mentioning 1MB? I have an astro app deployeed.
5 Replies
Rowin
Rowin2w ago
@Rohan Vashisht https://developers.cloudflare.com/workers/platform/limits/#worker-size The limit on the free plan has been increased from 1 MB to 3 MB by the way.
Rohan Vashisht
Rohan VashishtOP2w ago
Thanks a lot, Does this 3mb include imported json files? The thing is that I have tsx file which imports json and that json is huge, So, does this 3mb include import json?
Rowin
Rowin2w ago
Yes it does
Rohan Vashisht
Rohan VashishtOP2w ago
Any possible way we can restrict including json files in this limit? Because as far as I know the limit of 3mb is set to reduce boot time, but I don't think json would increase boot time?
Rowin
Rowin2w ago
It would, the entire worker is loaded into memory Excluding the JSON file doesn't really make sense considering you're importing it
Want results from more Discord servers?
Add your server