Skip to content

Expression-based asset URLs are not rewritten in Docker/self-hosted exports #5763

@lucasbergstrand

Description

@lucasbergstrand

When using the normal asset picker in Webstudio, exported Docker/self-hosted builds correctly rewrite asset URLs from: /cgi/image/ to optimized self-hosted paths such as: /_image/w_3840,q_80/assets/

However, when an asset is referenced through the expression editor using: assets.data["assetID"].url, the exported build still outputs the original /cgi/* URL. This results in a path that does not exist.

Reproduction Steps:

  1. Upload an asset such as an audio file
  2. Use the expression editor and reference the asset with:
    assets.data["assetID"].url as the source. In this example we'll use an
  3. Export the project as Docker/self-hosted
  4. Run the exported app
  5. Observe broken asset URLs

Here's a cloneable project already setup: https://p-2e368a08-eb25-4773-839e-137e37938dc2.apps.webstudio.is/?authToken=f9e8fb0f-1a74-4612-b51a-d746c8706b5a&mode=preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions