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.

Media upload returning undefined

default discord avatar
.gustavocardosolast year
3

Hello everyrone!



I cloned my project to a new machine. However, when I upload an image the url returns with undefined. I didn't change any settings, it's just a different machine (Macbook Air M1).



http://localhost:3000/admin/collections/undefined/media/science-5.svg

The older machine returns:



http://localhost:3000/media/science-5.svg

Does anyone have a clue?



Thanks!



The api returns this:

url: 'undefined/media/thought-catalog-505eectW54k-unsplash.jpg'

  • default discord avatar
    muperdevlast year

    hey my friend, did you set routes to land the medias on?



    like the media folder is created in your source?

  • default discord avatar
    .gustavocardosolast year

    Yeah! It's created in my source! It's weird because it's working on my Imac.



    I just set this in my .env; PAYLOAD_PUBLIC_EXTERNAL_SERVER_URL=

    http://localhost:3000

    it's working now!



    Maybe I'm being stupid but I don't remember doing that on my other machine!



    Anyway... thanks for your time!

  • default discord avatar
    muperdevlast year

    No worries



    You did the great

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.