Concrete
Rulespages

concrete/pages/section-not-exported

A page places a section no module exports, so the build cannot bundle it alone.

A page places a section no module exports, so the build cannot bundle it alone.

Graded by the composition 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

Every placed section is bundled alone, by importing the module that exports it and naming the export. Composition places a value, and a value no module exports has no entry point to bundle from — the page would render under concrete dev and the build would have nothing to write for it.

Fix

Export the section value from its own module (export const Hero = section(…)). One section per exported binding; a section built inside a page component, or assigned to a local, is invisible to discovery.

Before and after

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

// Declared, placed, and exported by nothing.
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 Home = () => <Hero />;
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 Home = () => <Hero />;

On this page