Where did serverPrefetch go in vue 3?

Hey all,

I’ve been trying to find any info around the lifecycle hook serverPrefetch that was introduced in vue 2.6, and also seemed to exist as onServerPrefetch in @vue/composition-api. It’s nowhere to be found in the codebase of vue-next when running a search and doesn’t seem to be mentioned in the docs either.

Was it scrapped? Is there any alternative to it for SSR?

2 Likes

Ohh good find! Looks like i was just a bit ahead of time! Thanks :smile:

Hi,

I’m trying to use serverPrefetch with Vue 3 composition-api.

import { onServerPrefetch } from 'vue'

// onServerPrefetch, seems to not exist

import { onServerPrefetch } from '@vue/composition-api' }

// onServerPrefetch exist

I’m pretty sure it’s not a good idea to use @vue/composition-api on a Vue 3 project :slight_smile:

Hi guys,
Is there any update of Vue3 composition API onServerPrefetch? Thank you