I’m encountering an issue while trying to publish my Next Js app on Cloudflare Workers. I keep receiving the following error message while deploying
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)
This error occurs specifically when I use the MUI (Material-UI) component library in multiple places within my code. Strangely, I don’t encounter this issue when I use MUI components in one or two places.
Could someone please advise on how to troubleshoot this error and potentially reduce the size of my script to meet Cloudflare’s size limit? I’d appreciate any insights or suggestions. Thanks in advance!
after attempting to mitigate the problem by removing MUI tags and replacing them with standard web tags, the issue no longer persists.