Skip to content

The fetch() hook is no longer called on the client-side in production/universal mode #374

@nicodotcomputer

Description

@nicodotcomputer

Hey!

First of all thanks for the nice work :)

I encountered something really strange and I'm not too sure about it but it looks like that the new fetch() hook of nuxt is not called on the client-side when in production mode:

Version

@nuxt/content: ^1.6.0
nuxt: 2.14.0

Steps to reproduce

Create a dynamic page component with a fetch() hook (example: pages/projects/_slug.vue).

export default {
  fetch() {
    console.log('fetch');
  }
}

What is Expected?

Fetch to be called when navigation occurs and a project is shown on the client side.

What is actually happening?

Fetch is only called on the client side when in development mode. In production mode, it is never called (only on the server).

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions