← Back to Demo Hub
Test #1Basic Errors

Null Reference Error

Accessing a property of a null object - one of the most common JavaScript errors.

📋 Demo Instructions

  1. Click the "Trigger Error" button below
  2. Open browser console (F12) to see the error
  3. Wait 5-10 seconds for the error to be captured
  4. Go to Dashboard → Performance Monitoring
  5. Click "Fix with Carla" on the error
  6. Review the generated PR
🌍 Real-World Scenario
API returns null instead of the expected user object. This happens when the backend can't find the requested resource or returns an error response that gets parsed as null.
✅ Expected Fix
Add optional chaining (?.) to safely access nested properties, or add an explicit null check before accessing properties.
Fix Confidence:HIGH

💻 Buggy Code

// Buggy Code
const user = null;
console.log(user.name);
// TypeError: Cannot read properties of null (reading 'name')

🔴 Error Log

Waiting for error to be triggered...