Skip to content

Commit

Permalink
fix(sourcemap): update sourcemap, remove checker (vercel/turborepo#7823)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
kwonoj authored Mar 24, 2024
1 parent 37127ce commit 539ff2c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions crates/turbopack-core/src/source_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,6 @@ impl SourceMap {
SourceMap::Decoded(map) => {
let mut token = map
.lookup_token(line as u32, column as u32)
// The sourcemap crate incorrectly returns a previous line's token when there's
// not a match on this line.
.filter(|t| t.get_dst_line() == line as u32)
.map(Token::from)
.unwrap_or_else(|| {
Token::Synthetic(SyntheticToken {
Expand Down

0 comments on commit 539ff2c

Please sign in to comment.