concrete/logic/section-build-failed
A placed section's logic bundle fails to build, as when React reaches it through a compute closure.
A placed section's logic bundle fails to build, as when React reaches it through a compute closure.
Graded by the logic 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 ships twice: a renderer, and a logic bundle carrying the code the platform runs
without React — the compute() sources behind facts and provenance,
the fill decisions, the visibility rules. That bundle is built from your module with React
resolved to a stub, so anything the logic reaches must be plain data and plain functions;
a closure that reaches a component keeps React alive in a bundle that has none, and the
build stops naming the module that got there.
Fix
Keep every compute() closure to values and pure helpers. Move a helper that renders —
or that a component is in the way of — out of the closure's reach, and let the render
function do the rendering with what compute() returned.
Before and after
import { compute, fact, Section, section, Slot, text } from "@homepages/concrete";
const Badge = ({ count }: { count: number }) => <span>{count}</span>;
// The closure reaches a component, so React survives into the logic bundle.
export const Stats = section(
{
key: "stats",
label: "Stats",
slots: { summary: text.short({ label: "Summary", source: compute({ reads: [fact.property.uploads] }, (uploads) => `${Badge.name}: ${String(uploads.length)}`) }) },
},
({ slot }) => (
<Section>
<Slot.Text slot={slot.summary} as="p" />
</Section>
),
);import { compute, fact, Section, section, Slot, text } from "@homepages/concrete";
export const Stats = section(
{
key: "stats",
label: "Stats",
slots: { summary: text.short({ label: "Summary", source: compute({ reads: [fact.property.uploads] }, (uploads) => `${String(uploads.length)} uploads`) }) },
},
({ slot }) => (
<Section>
<Slot.Text slot={slot.summary} as="p" />
</Section>
),
);