-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problems
-
Null pointer crash in
generateMetadata—src/app/[slug]/page.tsx:17-18
page!.titleandpage!.excerptcrash the entire build ifgetPageBySlugreturns null (malformed or missing MDX file). Add a null check and return fallback metadata. -
CSS injection via
themeColor—src/app/[slug]/layout.tsx:25-29
FrontmatterthemeColoris interpolated directly into a<style>block. Validate against/^#[0-9a-fA-F]{3,8}$/before rendering. -
getPageBySlugcalled 4 times per page —src/app/[slug]/page.tsx+layout.tsx
Same MDX file is read and parsed ingenerateMetadata,Page,generateViewport, andSlugLayout. Wrap with Reactcache():import { cache } from 'react' export const getPageBySlugCached = cache(getPageBySlug)
-
PageDefinitionhas[name: string]: any—src/types.ts:15
Index signature defeats TypeScript safety. Remove it and explicitly type all used frontmatter fields.