Skip to content

Commit

Permalink
Turbopack: fix issue source location for special exports (#69132)
Browse files Browse the repository at this point in the history
Before:
```
 ✓ Compiled / in 2.4s
 ⚠ ./bench/basic-app/app/page.js:7:25
Unable to parse config export in source file1
  5 | }
  6 |
> 7 | export const dynamic = 'force-dynamicc'
    |                         ^^^^^^^^^^^^^^^
> 8 |
    | ^
```

After:
```
 ⚠ ./bench/basic-app/app/page.js:7:24
Unable to parse config export in source file1
  5 | }
  6 |
> 7 | export const dynamic = 'force-dynamicc'
    |                        ^^^^^^^^^^^^^^^^
  8 |
```
  • Loading branch information
mischnic authored Aug 21, 2024
1 parent ac0d72a commit 0ac10d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/next-core/src/app_segment_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ pub async fn parse_segment_config_from_source(
}

fn issue_source(source: Vc<Box<dyn Source>>, span: Span) -> Vc<IssueSource> {
IssueSource::from_byte_offset(source, span.lo.to_usize(), span.hi.to_usize())
IssueSource::from_swc_offsets(source, span.lo.to_usize(), span.hi.to_usize())
}

fn parse_config_value(
Expand Down

0 comments on commit 0ac10d7

Please sign in to comment.