Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.3.2
Plugin version
5.3.2
Node.js version
20.11.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
sequoia
Description
I'm just trying to get started with fastify/vue and checking the basics.
Using the boilerplate "index.vue" I tried to add an onEnter function to change the clientOnly value of the context in dev mode and reloaded the page looking at the source code.
export function onEnter(ctx) {
ctx.clientOnly = true;
}
Nothing happened, there is still html output in the root div of the sourcecode of the page (using
view-source:http://localhost:3000/
), although the console shows
[vite] program reload
[vite] program reload
After terminating the server (CTRL + C) and restarting using npm run dev
I can see that now the root div is empty, so the content is rendered on the client.
I guess a program reload should be enough to switch the clientOnly rendering behaviour (?)
Link to code that reproduces the bug
https://github.com/bschelling/fastify-vue-clientonly/blob/main/client/pages/index.vue
Expected Behavior
Reload in devmode show switch the clientOnly mode.