video/mp4 files are saying "404 - Not Found" when Payload is deployed

default discord avatar
7 months ago

Hey all, Just wondering if I am missing something in regards to storing video/mp4 files in PayloadCMS.

Running Payload locally, the mp4 file is viewable and I can fetch it and use it in my front end Next.js website. However, when we deploy Payload, it throws a 404 - not found error when trying to fetch the mp4 video.

I have allowed mp4 files in the mimeTypes, is there anything else I need to do in order to get this to work?

mimeTypes: ['image/*', 'video/mp4'],

Payload is being run as a docker container on an Azure App Service.

OK, so building Payload locally using

yarn build

I've noticed that the .mp4 files aren't being put into the /dist/media folder. What would be the reason for this? Is there a way to force these files to be included during the build?

  • discord user avatar
    Payload Team
    7 months ago

    Cross-posting this here from general, so others can find it:

    The default


    script in the package.json is

    copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/"

    . I would think adding mp4 to that list would work for you.

    This is needed because typescript's compiler only handles compilation of files and is not able to move any other files.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.