New file size restrictions on Expo Build?

Please provide the following:

  1. SDK Version: 34.0.0
  2. Platforms: iOS

I’ve just reduced the size of the MP3s on my app to half, by reducing the bitrate. So the folder size has gone from 80mb, to 40mb

However, when I go to upload the app - I’m getting the “Request failed with status code 413” message. As in, one of the MP3s is too large to upload. If I add the old larger MP3s back into the folder, it works fine - saying “assets already uploaded”.

Is this a recent change? As in the last few months or so? Seems weird that I’ve reduced the size of the Mp3s and now I can’t upload them.

Thanks for any help

hi there! are you using the latest version of expo-cli?

Thanks for the quick reply!

No, I am using 3.11.9. Do I need to upgrade? Or do I need do downgrade even?!

it would be best to do so, there was an intermittent bug in expo-cli that regressed the file size limits while we were migrating to a new api endpoint

OK thanks for another quick reply. Just trying now!

Hi @notbrent

I’ve updated the CLI to the latest, I am now getting better messaging:

The request body is too large. The file you are uploading is 30.0 MB, which exceeds the 30 MB limit.

The odd thing is, no file is larger than 10MB - most are 1mb or 2mb. Does this mean that the assets overall can’t be larger than 30MB? Seems strange as only last week I managed to upload the files at a higher bitrate - total folder size of assets was 80mb.

Thanks again

1 Like

For anyone coming here later - I found a way around this…at least it appears to have built successfully.

I removed half the MP3 files and all imports for them in the JS modules - enough to bring the overall assets folder to below 30mb.

I then created a build and ran it to completion. After that, I added the files I’d deleted back into the build and the imports into the JS files - as half the files had already been uploaded, the build script only detected the new files, which totalled below 30mb, and then only uploaded the new ones.

So basically, split it into 2 separate uploads.

thanks for the info, we’ll investigate it and get back to you

can you try doing the build with the EXPO_LEGACY_API set to true?

EXPO_LEGACY_API=true expo build:ios

Hi, would you mind telling us how large your original upload was? The one that violated the 30mb limit?

Thanks for your replies everyone.

Hi @notbrent - tried with the legacy setting, it didn’t throw any errors, but it skipped uploading the assets again, as they were already there. Let me know if you need me to try something different.

Uploading assets
No assets changed, skipped.

@jkhales - the original assets folder in total, was 80MB. Which used to work.
After I’d optimised all the MP3s, the total folder size was 40MB, but because they were new files, it was re-uploading them and that’s where the 30MB error was coming up.

Thanks again, everyone.

OK yea, we had imposed a new 30mb upload limit recently to help keep our costs under control and servers stable. We are going to do a better job about publicizing that. In the mean time we’ve increased the limit to 50mb and should be deploying that by end of day.

Thanks for letting me know @jkhales

Also, thanks for working on such a great tool, everyone! Expo is awesome.

1 Like

After reading about your problem, I was wondering why the need to include the full mp3 object folder in your build!!! I know one quick answer would be for better performance. Nonetheless, you could still get an appreciable (or even better) performance by storing the actual mp3 objects in a cloud location, the keys in a database and fetching them in your app as at when needed.