Concrete
Rulesrelations

concrete/relations/unplaced-read

A declaration reads a section no page places, so the read resolves to no instance.

A declaration reads a section no page places, so the read resolves to no instance.

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

Reason

A ref names a SECTION and a slot, never an instance. The composition is what turns that into an instance: the section's first placement in page order is the one a read resolves to. A section no page places has no first placement, so the read resolves to nothing at all, and nothing is what the reading slot would settle on every time.

The declaration is not wrong on its own, which is why this is a composition finding rather than a compile error: the same section module is correct in a template whose site map places both.

Fix

Either place the section the read names, or drop the read. If the section is deliberately absent from this template, the reading slot needs a value that does not depend on it — the facts, or an authored value the editor fills.

Before and after

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

export const Amenities = section(
  { key: "amenities", label: "Amenities", slots: { heading: text.short({ label: "Heading", cap: 40 }) } },
  ({ slot }) => (
    <Section>
      <Slot.Text slot={slot.heading} as="h2" />
    </Section>
  ),
);

export const Hero = section(
  {
    key: "hero",
    label: "Hero",
    slots: {
      headline: text.medium({
        label: "Headline",
        cap: 60,
        source: compute({ reads: [Amenities.slots.heading] }, (heading) => heading ?? ""),
      }),
    },
  },
  ({ slot }) => (
    <Section>
      <Slot.Text slot={slot.headline} as="h1" />
    </Section>
  ),
);

// The site map places the hero and not the amenities, so the read resolves to nothing.
export const Home = () => <Hero />;
import { Section, section, Slot, text } from "@homepages/concrete";

declare const Hero: () => React.ReactNode;
declare const Amenities: () => React.ReactNode;

// Place the section the read names.
export const Home = () => (
  <>
    <Hero />
    <Amenities />
  </>
);

// Or drop the read, and let the hero own its own headline.
export const PlainHero = section(
  { key: "hero", label: "Hero", slots: { headline: text.medium({ label: "Headline", cap: 60 }) } },
  ({ slot }) => (
    <Section>
      <Slot.Text slot={slot.headline} as="h1" />
    </Section>
  ),
);

On this page