diff --git a/lib/serialize-error.js b/lib/serialize-error.js index 1cff9b8b0..ef07cb12b 100644 --- a/lib/serialize-error.js +++ b/lib/serialize-error.js @@ -113,6 +113,7 @@ function trySerializeError(err, shouldBeautifyStack) { if (lines[index].startsWith(' at')) { break; } + const next = index + 1; const end = next === lines.length || lines[next].startsWith(' at'); retval.summary += end ? lines[index] : lines[index] + '\n';