Skip to content

Commit 4ff86e1

Browse files
fix: export init hook from get_hooks (#13136)
* fix: export `init` hook from `get_hooks` * Create sour-pigs-talk.md * fix: create `init` variable
1 parent 50ec8e9 commit 4ff86e1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/sour-pigs-talk.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: export `init` hook from `get_hooks`

packages/kit/src/core/sync/write_server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export async function get_hooks() {
6767
let handle;
6868
let handleFetch;
6969
let handleError;
70-
${server_hooks ? `({ handle, handleFetch, handleError } = await import(${s(server_hooks)}));` : ''}
70+
let init;
71+
${server_hooks ? `({ handle, handleFetch, handleError, init } = await import(${s(server_hooks)}));` : ''}
7172
7273
let reroute;
7374
${universal_hooks ? `({ reroute } = await import(${s(universal_hooks)}));` : ''}
@@ -77,6 +78,7 @@ export async function get_hooks() {
7778
handleFetch,
7879
handleError,
7980
reroute,
81+
init,
8082
};
8183
}
8284

0 commit comments

Comments
 (0)