Skip to content

Commit e967dc8

Browse files
committed
fix: add empty stack to CompileDiagnostic to show error on build
1 parent da1fefc commit e967dc8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.changeset/brave-fans-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: add empty stack to `CompileDiagnostic` to show error on build

packages/svelte/src/compiler/utils/compile_diagnostic.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function get_code_frame(source, line, column) {
3939
* @typedef {{
4040
* code: string;
4141
* message: string;
42+
* stack: string;
4243
* filename?: string;
4344
* start?: Location;
4445
* end?: Location;
@@ -50,6 +51,7 @@ function get_code_frame(source, line, column) {
5051
/** @implements {ICompileDiagnostic} */
5152
export class CompileDiagnostic {
5253
name = 'CompileDiagnostic';
54+
stack = '';
5355

5456
/**
5557
* @param {string} code

packages/svelte/tests/migrate/samples/impossible-migrate-with-errors/_config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default test({
2020
^`,
2121
message: 'Unexpected end of input',
2222
name: 'CompileError',
23+
stack: '',
2324
position: [30, 30],
2425
start: {
2526
character: 30,

0 commit comments

Comments
 (0)