Skip to content

Commit 1d17477

Browse files
authored
fix: throw error when file can't be found in Vite manifest (#9558)
Prevents an infinite loop which makes debugging such errors harder
1 parent 80e95e2 commit 1d17477

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/great-ways-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: throw error when file can't be found in Vite manifest

packages/kit/src/exports/vite/build/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ export function find_deps(manifest, entry, add_dynamic_css) {
7272
*/
7373
export function resolve_symlinks(manifest, file) {
7474
while (!manifest[file]) {
75-
file = path.relative('.', fs.realpathSync(file));
75+
const next = path.relative('.', fs.realpathSync(file));
76+
if (next === file) throw new Error(`Could not find file "${file}" in Vite manifest`);
77+
file = next;
7678
}
7779

7880
const chunk = manifest[file];

0 commit comments

Comments
 (0)