Concrete
Rulesrender

concrete/render/unresolved-media

A rendered fixture media URL names no file the fixture load produced.

A rendered fixture media URL names no file the fixture load produced.

Graded by the render stage of concrete check, in the render venue. A violation reports this id and the file it failed at — see every rule and concrete check.

Reason

Every media URL a rendered page carries has to come from somewhere the build knows about: a fixture's property, whose load mints the URL, or a file a module imported, which ships content-hashed beside the bundle. A fixture is what makes the first kind resolvable at all — the id is looked up and the URL minted for it. A path typed into the markup belongs to neither, so it resolves to nothing in the playground and to nothing on a published page.

Fix

Import the file (import crest from "./crest.svg"), which makes it an author asset the build ships, or bind the value to a slot and let the fixture's property supply it. A string path is a guess about a directory layout the published artifact does not have.

Before and after

import { Section, section, Slot, text } from "@homepages/concrete";

export const Hero = section(
  { key: "hero", label: "Hero", slots: { headline: text.medium({ label: "Headline" }) } },
  ({ slot }) => (
    <Section>
      <img src="/media/crest.svg" alt="" width={48} height={48} />
      <Slot.Text slot={slot.headline} as="h1" />
    </Section>
  ),
);
import { Section, section, Slot, text } from "@homepages/concrete";
import crest from "./crest.svg";

export const Hero = section(
  { key: "hero", label: "Hero", slots: { headline: text.medium({ label: "Headline" }) } },
  ({ slot }) => (
    <Section>
      <img src={crest} alt="" width={48} height={48} />
      <Slot.Text slot={slot.headline} as="h1" />
    </Section>
  ),
);

On this page