Media upload returning undefined

default discord avatar
.gustavocardoso
2 months ago
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
    muperdev
    2 months ago

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



    like the media folder is created in your source?

  • default discord avatar
    .gustavocardoso
    2 months ago

    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
    muperdev
    last month

    No worries



    You did the great

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

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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