Summary
/growth throws an uncaught client-side exception ("Application error: a client-side exception has occurred") for every install that hasn't set up the optional USER/CUSTOMIZATIONS/TOOLS/Growth module — which is the default state for most users.
Root cause
PULSE/Observability/src/app/growth/page.tsx expects /api/life/growth to always return:
interface GrowthData {
generatedAt: string;
newsletter: {...} | null;
youtube: {...} | null;
web: {...} | null;
errors: string[];
}
But handleLifeGrowth in PULSE/Observability/observability.ts returns a different shape when the optional Growth customization isn't installed:
if (!growthMod?.fetchGrowth) {
return Response.json({ growth: null, installed: false, note: "Growth is an optional customization; not installed." })
}
This response is 200 OK, so the frontend's r.ok check passes and setData(...) stores the mismatched object. Rendering then hits:
{data.errors.length > 0 && ...}
data.errors is undefined on this shape → TypeError: Cannot read properties of undefined (reading 'length') thrown during render → uncaught → Next.js's default error boundary.
Reproduction
- Fresh install, don't set up
USER/CUSTOMIZATIONS/TOOLS/Growth.
- Open Pulse dashboard → Growth tab.
- "Application error: a client-side exception has occurred."
Proposed fix
Make the "not installed" branch return the same shape the frontend expects, so the page's existing "not connected" UI renders instead of crashing:
if (!growthMod?.fetchGrowth) {
return Response.json({
generatedAt: new Date().toISOString(),
newsletter: null, youtube: null, web: null, errors: [],
installed: false,
note: "Growth is an optional customization; not installed.",
})
}
Verified this fix locally on a live install — the page now renders the intended "not connected" state cleanly.
Summary
/growththrows an uncaught client-side exception ("Application error: a client-side exception has occurred") for every install that hasn't set up the optionalUSER/CUSTOMIZATIONS/TOOLS/Growthmodule — which is the default state for most users.Root cause
PULSE/Observability/src/app/growth/page.tsxexpects/api/life/growthto always return:But
handleLifeGrowthinPULSE/Observability/observability.tsreturns a different shape when the optional Growth customization isn't installed:This response is
200 OK, so the frontend'sr.okcheck passes andsetData(...)stores the mismatched object. Rendering then hits:data.errorsisundefinedon this shape →TypeError: Cannot read properties of undefined (reading 'length')thrown during render → uncaught → Next.js's default error boundary.Reproduction
USER/CUSTOMIZATIONS/TOOLS/Growth.Proposed fix
Make the "not installed" branch return the same shape the frontend expects, so the page's existing "not connected" UI renders instead of crashing:
Verified this fix locally on a live install — the page now renders the intended "not connected" state cleanly.