Unable to deploy app to moralis server - Request body larger than maxBodyLength


I am trying to deploy my react app to moralis, however I get an error: Request body larger than maxBodyLength
Is there any way to control this parameter?

This is what I get on my console:

 moralis-admin-cli deploy -p build
Following servers were found:
What server do you want to connect to?: 1
En error occured when trying to deploy
Error [ERR_FR_MAX_BODY_LENGTH_EXCEEDED]: Request body larger than maxBodyLength limit
    at RedirectableRequest.write (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/follow-redirects/index.js:102:24)
    at FormData.ondata (internal/streams/legacy.js:19:31)
    at FormData.emit (events.js:315:20)
    at FormData.CombinedStream.write (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/combined-stream/lib/combined_stream.js:138:8)
    at DelayedStream.ondata (internal/streams/legacy.js:19:31)
    at DelayedStream.emit (events.js:315:20)
    at DelayedStream._handleEmit (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/delayed-stream/lib/delayed_stream.js:82:15)
    at ReadStream.source.emit (/usr/local/lib/node_modules/moralis-admin-cli/node_modules/delayed-stream/lib/delayed_stream.js:29:19)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9) {
  config: { ...


1 Like

Hey @nutrina, hope you are ok.

What is the total size of your project folder? for now, maximum size should be less than 64mb.

We can upgrade the size, but 64mb should be enough…let us know.

Carlos Z


Thanks for the response.
That is strange.
The size of my folder is only 43mb:

✗ du -h -d 0 build 
 43M    build

For now this is not an urgent topic for me, I have deployed on another server.


Hi @nutrina,
I have the same problem, can you please give me advice on what other server to use for free? It is quite urgent for me. Thanks.

I have the same problem. My folder is 83,4 Mb. When I uninstall moralis-admin-cli node_modules and run it from different folder (where I have moralis-admin-cli) it still does not work even though my folder is 60Mb. Can you please help? It is urgent. Thanks.

You can use GitHub pages: https://pages.github.com/ as a hosting alternative.

1 Like

Hi @cryptokid,

thanks, however I can’t upload my node_modules there, which is a huge file, and without that the website won’t run. Is it possible not having node_modules on my repository but to fetch it from other places so website can run? I need mainly web3, ethereum-block-by-date, node-fetch, jquery.

Not sure what you want to do, you should upload only what is needed for your website to run and not your entire development folder.

1 Like

Oh right. Sorry for this stupid question. I am new to this, I thought that you need node_modules on server too. It’s working now, maybe because I used browserify. Thanks.

1 Like

@cryptokid Can I have one more question out of topic please? Is it safe to share my Etherscan API key in code? I want it for the user to be as convenient as possible, so I would rather implement my code with my API key.

Otherwise user would need to create account on Etherscan, generate his own API key and then enter it in application. Which is not user-friendly.

1 Like

I guess that you can use it this way until you find a better way.

What is the size of the folder that you want to upload?
In case that you want to upload the entire development folder, you don’t need to do that, you only have to upload what is needed for the website to work.

I’m currently testing a workaround where I upload the files to the database, then pull from there as needed.

This workaround was successful.

1 Like

I’ve got a 33M site that hits the size limit error. What is the size limit today?

there is a buffer upload limit, that also is influenced by converting the data to base64.
but in theory 20MB could work to upload.

how is that you have a 33MB site?

We’ve switched to Netlify for hosting. I’ve no idea how our simple wallet site compiles to something that big. It’s just ReactJS, Material.io, Moralis.io, Transak, and a few .svg images. See for yourself.