Skip to content

Commit

Permalink
fix: revert using server read for load function fetch (#12876)
Browse files Browse the repository at this point in the history
* revert server read for fetch

* changeset

* check file existance instead

---------

Co-authored-by: Simon H <[email protected]>
  • Loading branch information
eltigerchino and dummdidumm authored Oct 25, 2024
1 parent 3a9b78f commit 4cdbf76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eight-insects-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: don't try reading assets directly that aren't present
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function create_fetch({ event, options, manifest, state, get_cookie_heade
return new Response(state.read(file), {
headers: type ? { 'content-type': type } : {}
});
} else if (read_implementation) {
} else if (read_implementation && file in manifest._.server_assets) {
const length = manifest._.server_assets[file];
const type = manifest.mimeTypes[file.slice(file.lastIndexOf('.'))];

Expand Down

0 comments on commit 4cdbf76

Please sign in to comment.