Skip to content

Commit 844adaa

Browse files
committed
chore: exclude vite optimized deps from stack traces
1 parent 3009a02 commit 844adaa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/dirty-planes-tell.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+
chore: exclude vite optimized deps from stack traces

packages/svelte/src/internal/client/dev/tracing.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,20 @@ export function get_stack(label) {
153153

154154
for (let i = 0; i < lines.length; i++) {
155155
const line = lines[i];
156+
const posixified = line.replaceAll('\\', '/');
156157

157158
if (line === 'Error') {
158159
continue;
159160
}
161+
160162
if (line.includes('validate_each_keys')) {
161163
return null;
162164
}
163-
if (line.includes('svelte/src/internal') || line.includes('svelte\\src\\internal')) {
165+
166+
if (posixified.includes('svelte/src/internal') || posixified.includes('node_modules/.vite')) {
164167
continue;
165168
}
169+
166170
new_lines.push(line);
167171
}
168172

0 commit comments

Comments
 (0)