Skip to content

clientOnly not updated on reload in dev mode #270

Open
@bschelling

Description

@bschelling

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions