diff --git a/docs/content/2.advanced/1.vue-instantsearch.md b/docs/content/2.advanced/1.vue-instantsearch.md index fe84019..90716e6 100644 --- a/docs/content/2.advanced/1.vue-instantsearch.md +++ b/docs/content/2.advanced/1.vue-instantsearch.md @@ -84,7 +84,7 @@ onBeforeMount(() => { }) const { data: algoliaState } = await useAsyncData('algolia-state', async () => { - if (process.server) { + if (import.meta.server) { const nuxtApp = useNuxtApp(); nuxtApp.$algolia.transporter.requester = ( await import('@algolia/requester-node-http').then( diff --git a/src/runtime/components/AlgoliaDocSearch.vue b/src/runtime/components/AlgoliaDocSearch.vue index 3194e54..a1357ca 100644 --- a/src/runtime/components/AlgoliaDocSearch.vue +++ b/src/runtime/components/AlgoliaDocSearch.vue @@ -150,7 +150,7 @@ const importDocSearchAtRuntime = async (): Promise => { // @ts-ignore import(/* webpackChunkName: "docsearch" */ '@docsearch/js'), // @ts-ignore - process.client && import(/* webpackChunkName: "docsearch" */ '@docsearch/css') + import.meta.client && import(/* webpackChunkName: "docsearch" */ '@docsearch/css') ]) return docsearch.default @@ -246,7 +246,7 @@ onMounted(async () => { await initialize() }) -if (process.client) { +if (import.meta.client) { watch(props, async () => { await initialize() }) diff --git a/src/runtime/composables/useAlgoliaSearch.ts b/src/runtime/composables/useAlgoliaSearch.ts index e915bf1..03dab9c 100644 --- a/src/runtime/composables/useAlgoliaSearch.ts +++ b/src/runtime/composables/useAlgoliaSearch.ts @@ -25,7 +25,7 @@ export function useAlgoliaSearch (indexName?: string) { const result = useState(`${index}-search-result`, () => null) const search = async ({ query, requestOptions }: SearchParams) => { - if (process.server) { + if (import.meta.server) { const nuxtApp = useNuxtApp() if (config.public.algolia.useFetch) { nuxtApp.$algolia.transporter.requester = (await import("@algolia/requester-fetch").then((lib) => lib.default || lib)).createFetchRequester(); diff --git a/src/runtime/composables/useAsyncAlgoliaSearch.ts b/src/runtime/composables/useAsyncAlgoliaSearch.ts index 61c0829..23dbdc5 100644 --- a/src/runtime/composables/useAsyncAlgoliaSearch.ts +++ b/src/runtime/composables/useAsyncAlgoliaSearch.ts @@ -14,7 +14,7 @@ export async function useAsyncAlgoliaSearch ({ query, requestOptions, indexName, const algoliaIndex = useAlgoliaInitIndex(index) const result = await useAsyncData(`${index}-async-search-result-${key ?? ''}`, async () => { - if (process.server) { + if (import.meta.server) { const nuxtApp = useNuxtApp() if (config.public.algolia.useFetch) { nuxtApp.$algolia.transporter.requester = (await import('@algolia/requester-fetch').then((lib) => lib.default || lib)).createFetchRequester();