Runbook: Cannot Read Properties of Undefined 'includes'
| Service | Webku x Tripla Page |
|---|---|
| Owner Team slack handle | @bnl-dev-bali |
| Team's Slack Channel | #bnl-teams-b |
Table of Contents
- [[#Important Links]]
- [[#1. Triage]]
- [[#2. Decision Point]]
- [[#3. False Alarm]]
- [[#4. True Incident]]
- [[#4.1. Recover the System]]
- [[#4.2. Clean up]]
Important Links
| Alert | [Sentry Issue Link – TypeError includes undefined] |
|---|---|
| Affected URL | /dashboard/sites/{site}/content/edit |
| Fix Commit | MERGE PR |
1. Triage
Goal: Confirm issue is caused by missing ?page= query parameter.
- Open Sentry issue.
- Confirm error message:
TypeError: Cannot read properties of undefined (reading 'includes')
- Access page without query parameter:
https://webku.bookandlink.com/en/dashboard/sites/{site}/content/edit
- Confirm
?page=is missing. - Check browser console for:
undefined.includes(...)
- Confirm whether fix commit has been deployed.
2. Decision Point
-
IF accessing URL without
?page=causes crash and fix not deployed...- ➡️ Go to: [[#4. True Incident]]
-
IF fallback or redirect already works correctly...
- ➡️ Go to: [[#3. False Alarm]]
3. False Alarm
- Confirm URL automatically redirects to:
?page=home
- Confirm no runtime error in console.
- Confirm no new Sentry logs for 15 minutes.
Post in Slack:
TypeError alert reviewed. Defensive validation working correctly.
No active incident.
4. True Incident
Impact:
- Content Edit page crashes.
- Users unable to edit site content.
- Unhandled frontend exception logged.
4.1. Recover the System
Diagnostic Steps
- Confirm missing
pagequery parameter. - Confirm
.includes()called on undefined value.
Remediation Plan
Option A:
- Add validation before calling
.includes().
Option B:
- Provide default fallback value:
const page = query.page ?? "home";
Option C:
- Automatically redirect to:
/content/edit?page=home
- Merge and deploy fix:
5cb3b6fa
Verification
- Access URL without
?page=does not crash. - Default page loads.
- No new TypeError logs in Sentry.
4.2. Clean up
- Confirm no failed content edits.
- Monitor Sentry for 30 minutes.
- Post resolution update in Slack:
TypeError resolved. Defensive validation deployed.
System stable.
- Update runbook if new edge cases discovered.