You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
… if serverURL is set in Payload's config
Replaces URL construction with dedicated media URL function
Implements a new utility function for constructing media URLs, enhancing code maintainability and clarity.
Updates the ImageMedia and VideoMedia components to utilize the new function for generating source URLs, improving consistency in URL handling.
Describe the Bug
When using the website template, if the
serverURL
is set, theImageMedia
generates an invalid URL with the origin applied twice.Link to the code that reproduces this issue
https://github.com/MasterAM/payload-media-image-issue
Reproduction Steps
Using the reproduction repo:
serverURL
configuration was added to themain
branch. It should error after seeding and navigating to the main page.with-data
branch. When running it, the website's front page would present the error.fix/image-media-url-error
branch.From scratch:
serverURL
value to the Payload config of a newly created website template.Which area(s) are affected? (Select all that apply)
area: templates
Environment Info
The text was updated successfully, but these errors were encountered: