Skip to content

Commit dccf277

Browse files
committed
drive by warnings fix for webcontainer
1 parent c9b51f0 commit dccf277

File tree

1 file changed

+3
-2
lines changed
  • apps/svelte.dev/src/lib/tutorial/adapters/webcontainer

1 file changed

+3
-2
lines changed

apps/svelte.dev/src/lib/tutorial/adapters/webcontainer/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ export async function create(base, error, progress, logs, warnings) {
6868
} else if (chunk?.startsWith('svelte:warnings:')) {
6969
/** @type {import('$lib/tutorial').Warning} */
7070
const warn = JSON.parse(chunk.slice(16));
71-
const current = $warnings[warn.filename];
71+
const filename = warn.filename.startsWith('/') ? warn.filename : '/' + warn.filename;
72+
const current = $warnings[filename];
7273

7374
if (!current) {
74-
$warnings[warn.filename] = [warn];
75+
$warnings[filename] = [warn];
7576
// the exact same warning may be given multiple times in a row
7677
} else if (!current.some((s) => s.code === warn.code && s.pos === warn.pos)) {
7778
current.push(warn);

0 commit comments

Comments
 (0)