Prerequisites
Live Preview is available when:- the task runs in an environment rather than directly against a repository
- an administrator has configured the deployment’s preview runtime
- the environment exposes at least one named preview port
- the app or API is running on the configured port
PREVIEW_PROXY_BASE_URL instead; see the
Live previews environment variables.
Configure application ports under Settings > Environments in the
Exposed Ports section. Choose a primary port when one service should open
first, and set an initial path when reviewers should land somewhere other than
/. See the environment definition port reference
for the equivalent YAML and all supported port options.
Environment changes apply to new tasks. If ports were added after a task
started, start a new task or put the existing task to sleep and wake it again to
attach the preview.
Open and use a preview
- Open a task that runs in the configured environment.
- Select Live Preview in the task’s right sidebar.
- If the environment exposes multiple services, use the Available Services menu to switch between them.
Recover a preview
Use the state shown in the task to choose the next action:
If a preview opens but the app itself is broken, review the task’s Logs
panel. Common application-side causes include a server that did not start, a
port mismatch, or host, framing, and cross-origin rules that do not allow the
preview proxy.
Tasks that run directly against a repository do not have a sandbox application
to expose, so their task sidebar does not show Live Preview. Start the work
in an environment when it needs a runnable app or preview.
See Review a task for the other logs, diffs, artifacts, and visual
evidence available in the task workspace.