diff --git a/lib/worker/line-numbers.js b/lib/worker/line-numbers.js index c7865f85f..b7031d49b 100644 --- a/lib/worker/line-numbers.js +++ b/lib/worker/line-numbers.js @@ -66,6 +66,13 @@ const translate = (sourceMap, pos) => { } const entry = sourceMap.findEntry(pos.line - 1, pos.column); // Source maps are 0-based + + // When used with ts-node/register, we've seen entries without original values. Return the + // original position. + if (entry.originalLine === undefined || entry.originalColumn === undefined) { + return pos; + } + return { line: entry.originalLine + 1, // Readjust for Acorn. column: entry.originalColumn,