concrete/workspace/duplicate-section-key
Two different exported sections declare the same key.
Two different exported sections declare the same key.
Graded by the workspace stage of concrete check, in the tree venue. A violation reports this id and the file it failed at — see every rule and concrete check.
Reason
A section's key is its platform identity, never derived from a file name or a variable:
it is what a section is stored, filled, published and re-filled
under. Two exported sections sharing one key make that identity ambiguous — the platform
cannot tell which declaration a stored instance belongs to — so discovery refuses both
rather than picking one.
Fix
Give each section its own key. If what you wanted was the same section in two places,
keep one declaration and pass instance at the second placement instead: one section,
two instances, one schema.
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>
<Slot.Text slot={slot.headline} as="h1" />
</Section>
),
);
// A second declaration under the same key.
export const Banner = section(
{ key: "hero", label: "Banner", slots: { line: text.short({ label: "Line" }) } },
({ slot }) => (
<Section>
<Slot.Text slot={slot.line} as="p" />
</Section>
),
);import { Section, section, Slot, text } from "@homepages/concrete";
export const Hero = section(
{ key: "hero", label: "Hero", slots: { headline: text.medium({ label: "Headline" }) } },
({ slot }) => (
<Section>
<Slot.Text slot={slot.headline} as="h1" />
</Section>
),
);
export const Banner = section(
{ key: "banner", label: "Banner", slots: { line: text.short({ label: "Line" }) } },
({ slot }) => (
<Section>
<Slot.Text slot={slot.line} as="p" />
</Section>
),
);