spatie/sourcemaps-lookup
Fast, memory-efficient Source Map v3 lookup for PHP. Resolve JavaScript stack frames to original source file, line/column, symbol name, and enclosing scope. Optimized for the read path and high-volume error symbolicating from uploaded sourcemaps.
findGenerated() does the opposite of lookup(). Given an original source position, it returns where that position appears in the generated file. This is useful for editor tooling or coverage reports, not for stack trace resolution.
$generated = $map->findGenerated(fileIndex: 0, sourceLine: 6, sourceColumn: 20);
echo $generated->line; // 1-based line in the generated file
echo $generated->column; // 0-based column
Exact match only. There is no nearest preceding fallback. Unknown positions return null.
The first call builds a full reverse index (parses every line), so callers who only use lookup() never pay this cost.
How can I help you explore Laravel packages today?