-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
Due to the documentation, the hooks.js handle function should run on every request. See: https://kit.svelte.dev/docs/hooks#handle.
For me, it seems that the hooks.js is not called on client side navigation. I'm not sure if this is really a bug, but I couldn't find anything else in the documentation. If it's not a bug, it would be great if there is at least a note in the docs that it's not executed on client-side navigation.
Reproduction
Create a new project, choose the demo-app and put a console.log(event.url.pathname) in the existing hooks.js handle function.
npm init svelte@next my-app
cd my-app
npm install
npm run dev
Navigate between the different pages using the navigation bar of the application. Observe the console output and see that the navigations are not logged. This means, the hooks.js handle function is not executed on every request as stated in the docs.
Logs
No response
System Info
System:
OS: Linux 5.15 Manjaro Linux
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 802.46 MB / 7.65 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 17.7.1 - /usr/bin/node
npm: 8.5.4 - /usr/bin/npm
Browsers:
Chromium: 100.0.4896.75
Firefox: 99.0
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.34
@sveltejs/kit: next => 1.0.0-next.307
svelte: ^3.46.0 => 3.46.6Severity
annoyance
Additional Information
No response