diff --git a/src/lib/components/editor/(filesystem)/index.ts b/src/lib/components/editor/(filesystem)/index.ts index 34b1fb347..a34e8db4f 100644 --- a/src/lib/components/editor/(filesystem)/index.ts +++ b/src/lib/components/editor/(filesystem)/index.ts @@ -72,8 +72,10 @@ export function treeFromFilesystem(files: SvelteSet): TreeItem[] { const tree: TreeItem[] = []; for (const path of Array.from(files)) { - const normalizedPath = path.endsWith('/') ? path.slice(0, -1) : path; - + let normalizedPath = path.endsWith('/') ? path.slice(0, -1) : path; + if (normalizedPath.startsWith('/')) { + normalizedPath = normalizedPath.slice(1); + } if (!normalizedPath) continue; const parts = normalizedPath.split('/');