Node.jsexit code > 0

ReferenceError: ... is not defined

$ReferenceError: myVar is not defined

Analysis

You are trying to use a variable that hasn't been declared or is out of scope.

Common Triggers

  • Typo in variable name.
  • Using a variable inside a function that was declared in another function (scope issue).

Debug Checks

  • $Check lines mentioned in the stack trace for typos.

Resolution

1
Declare the variable with const, let, or var.
2
Ensure the variable is in the correct scope.