An account layout has an @orders slot, and you add a settings page. What does next build say?
Leaf and Kettle's account section shows the customer's orders beside every account page, from a parallel route slot, @orders, that the account layout renders next to children. You add a settings page at app/account/settings/page.tsx and nothing else. What happens when you build the app?
app/layout.tsxexport const metadata = { title: "Leaf and Kettle" };
export default function RootLayout({ children }: LayoutProps<"/">) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
app/account/layout.tsxexport default function AccountLayout({ children, orders }: LayoutProps<"/account">) {
return (
<>
<main>{children}</main>
<aside>{orders}</aside>
</>
);
}
app/account/page.tsxexport default function AccountPage() {
return <h1>Your account</h1>;
}
app/account/@orders/page.tsxexport default function RecentOrders() {
return (
<>
<h2>Your orders</h2>
<p>Order 1042: Green tea</p>
</>
);
}
app/account/settings/page.tsxexport default function SettingsPage() {
return <h1>Settings</h1>;
}
It's a project create-next-app made (Next.js 16.4.3, TypeScript, the App Router, and Cache Components on) with these files, built with next build. What happens:
- You run
next build.
The answer
Work out what Next.js does at each step: what the build prints, what each request answers, and what the page shows. Then check.
Checking your sign-in…