Skip to content

Commit 4e3cd1a

Browse files
authored
fix(sourcemap): update sourcemap, remove checker (vercel/turborepo#7823)
### Description While debugging https://vercel.slack.com/archives/C03EWR7LGEN/p1711146825831219?thread_ts=1711143217.892349&cid=C03EWR7LGEN, found out sourcemap lookup fails on certain source and always returns synthetictoken only. Weirdly, the guards in this PR https://github.com/vercel/turbo/pull/7823/files#diff-2ce67e28c5b3144ec6f7a89167f3c96da9f9e268abf3fd685ce881d75a4cd8a5L319 is preventing those lookup - removing it makes correct sourcemap lookup occurs. I updated pkg to the version what swc uses and removed + ran next.js tests, seems like most of tests are running just fine (#63624) Still not 100% sure if this'll be ok or not, if not open to change for the correct fixes. Some related fixes getsentry/rust-sourcemap#60 might be the reason we don't see any regressions in the test.
1 parent 4eb6304 commit 4e3cd1a

File tree

1 file changed

+0
-3
lines changed
  • crates/turbopack-core/src/source_map

1 file changed

+0
-3
lines changed

crates/turbopack-core/src/source_map/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,6 @@ impl SourceMap {
316316
SourceMap::Decoded(map) => {
317317
let mut token = map
318318
.lookup_token(line as u32, column as u32)
319-
// The sourcemap crate incorrectly returns a previous line's token when there's
320-
// not a match on this line.
321-
.filter(|t| t.get_dst_line() == line as u32)
322319
.map(Token::from)
323320
.unwrap_or_else(|| {
324321
Token::Synthetic(SyntheticToken {

0 commit comments

Comments
 (0)