Problem
Visiting a chapter whose AI-generated content has an unexpected data type
(e.g. para content being an array instead of a string, or code content
being null) causes a full client-side application error — the entire
page crashes with a white screen.
Steps to Reproduce
- Open any roadmap with a do-while loop or complex code chapter
- AI generates the chapter with
para content as an array OR code
content as null
- ❌ Page shows: "Application error: a client-side exception has occurred"
Root Cause
In src/components/chapter_content/Content.jsx:
Bug 1 — para with array content crashes dangerouslySetInnerHTML:
// ❌ Crashes if AI returns content: ["line1", "line2"] instead of a string
dangerouslySetInnerHTML={{ __html: item.content }}

Problem
Visiting a chapter whose AI-generated content has an unexpected data type
(e.g.
paracontent being an array instead of a string, or code contentbeing
null) causes a full client-side application error — the entirepage crashes with a white screen.
Steps to Reproduce
paracontent as an array OR codecontent as
nullRoot Cause
In src/components/chapter_content/Content.jsx:
Bug 1 —
parawith array content crashesdangerouslySetInnerHTML: