Skip to content

Commit

Permalink
fix: stack track point to incorrect file. (vitest-dev#3004)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenKS12138 committed Apr 4, 2023
1 parent 326b242 commit ad5b120
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite-node/src/source-map-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ function mapSourcePosition(position: OriginalMapping) {
// better to give a precise location in the compiled file than a vague
// location in the original file.
if (originalPosition.source !== null) {
// `originalPositionFor` do not return the expected file source. So use `position.source`
// instead of `originalPosition.source`
originalPosition.source = supportRelativeURL(
sourceMap.url, originalPosition.source)
sourceMap.url, position.source)
return originalPosition
}
}
Expand Down

0 comments on commit ad5b120

Please sign in to comment.