Large Media 400 Bad Request with Nextjs


I’m trying to migrate an existing Netlify site (Using Gatsby) to Nextjs and make
use of git lfs + large media in a branch and am experiencing 400 responses for
all images in the deployed application.

I’ve followed the Large Media setup
(Large Media setup | Netlify Docs) and can see all the images in the
Large Media section of the Netlify dashboard.

The 400 responses can be seen on this deployed app:

The images are tracked using git lfs:

I’m using next/image, the src attribute is a string path relative to the public folder (e.g. /images/foo.jpg), everything works when running Next locally (next dev).

Any advice is much appreciated.


Hi Dan,

Large Media is a service that we don’t recommend using. I wouldn’t be surprised to hear that it is incompatible with Edge Functions, which by default drive much of our nextjs-runtime (especially around image handling in IPX).

In the end, we’ll recommend you don’t use large media today with any framework, but we won’t be able to debug it; we can help you deactivate it instead if you’d like, though, and I expect things will work better with serving your site once you aren’t using it anymore.


Thanks for getting back to me.

I was actually thinking about reaching out to disable it anyway as it’s additional complexity I’m not sure I really need, even if it did work well. I didn’t realise at the time when I enabled it that the process wasn’t reversible without manual intervention.

If you can please proceed with disabling it for my application, that would be much appreciated. Is there anything more you need from me?

Thanks again!

Thanks for letting us know you want to uninstall the Large Media add-on for your site. Would you please confirm you have read the following Support Guide?

If you have read that, please confirm you have backups of all files and let us know. We’ll reply soon to confirm the add-on has been uninstalled.

​Please let us know if there are any questions.


Thanks for getting back to me, yes I’ve read and understand the support document.

I have only implemented LFS in a branch, my main branch still has the existing production site and all associated files. I won’t be using LFS in the repo at all.

Thanks again


Is there anything else I need to do to initiate the uninstall of large media?

Thanks again


We have removed the Large Media add-on from the site now.

Would you please push the commit removing .lfsconfig to the upstream repository? This will trigger a new build.

Please keep in mind that you might want to run the command below after deleting the .lfsconfig file:

git lfs push --all origin

This will sync the local repo’s LFS objects with the Git LFS service at the original Git host. It pushes any new binary blobs to their LFS service which may have been added after you moved the LFS service to Large Media.

Please let us know if there are any issues with the new build or deployed site.