Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Images wont load in vercel production for client and admin using website template

default discord avatar
.innerdesireslast year
3

This is log from deployment, same for every media request


[16:17:50] ERROR: ENOENT: no such file or directory, stat '/vercel/path0/public/media/zz-hero-home-300x149.png'
err: {
"type": "Error",
"message": "ENOENT: no such file or directory, stat '/vercel/path0/public/media/zz-hero-home-300x149.png'",
"stack":
  • default discord avatar
    zed0547last year

    Hey

    @338085139433127946

    ,



    So, you've deployed your app to Vercel, very nice, but it looks like you're trying to use the local filesystem to store images. This won't work, and Payload (depending on what version you're on) should've generated some warnings for you.



    The issue is that serverless providers don't really have a concept of a local filesystem in the traditional sense.



    It's ephemeral



    To fix this, you need to use a storage-adapter to store your images somewhere for later consumption:

    https://payloadcms.com/docs/upload/storage-adapters
  • default discord avatar
    .innerdesireslast year
    @654031862146007055

    Looking at it. Thanks a lot.

  • default discord avatar
    zed0547last year

    It's my pleasure

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.