You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Null pointer crash in generateMetadata — src/app/[slug]/page.tsx:17-18 page!.title and page!.excerpt crash the entire build if getPageBySlug returns 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
Frontmatter themeColor is interpolated directly into a <style> block. Validate against /^#[0-9a-fA-F]{3,8}$/ before rendering.
getPageBySlug called 4 times per page — src/app/[slug]/page.tsx + layout.tsx
Same MDX file is read and parsed in generateMetadata, Page, generateViewport, and SlugLayout. Wrap with React cache():
PageDefinition has [name: string]: any — src/types.ts:15
Index signature defeats TypeScript safety. Remove it and explicitly type all used frontmatter fields.
Problems
Null pointer crash in
generateMetadata—src/app/[slug]/page.tsx:17-18page!.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-29Frontmatter
themeColoris 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.tsxSame MDX file is read and parsed in
generateMetadata,Page,generateViewport, andSlugLayout. Wrap with Reactcache():PageDefinitionhas[name: string]: any—src/types.ts:15Index signature defeats TypeScript safety. Remove it and explicitly type all used frontmatter fields.