Skip to content

Commit

Permalink
fix: throw error when file can't be found in Vite manifest
Browse files Browse the repository at this point in the history
Prevents an infinite loop which makes debugging such errors harder
  • Loading branch information
dummdidumm committed Mar 30, 2023
1 parent ae6ddad commit 51379ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-ways-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: throw error when file can't be found in Vite manifest
4 changes: 3 additions & 1 deletion packages/kit/src/exports/vite/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export function find_deps(manifest, entry, add_dynamic_css) {
*/
export function resolve_symlinks(manifest, file) {
while (!manifest[file]) {
file = path.relative('.', fs.realpathSync(file));
const next = path.relative('.', fs.realpathSync(file));
if (next === file) throw new Error(`Could not find file "${file}" in Vite manifest`);
file = next;
}

const chunk = manifest[file];
Expand Down

0 comments on commit 51379ec

Please sign in to comment.