Closed gitFoxCode closed 1 year ago
Hey,
I dont have that much experience with Nuxt Content but it seems that the implementation of the DocSearch there is not correct.
In order to make it work properly, there should these two envs passed:
algolia: {
docSearch: {
indexName: process.env.ALGOLIA_DOCSEARCH_INDEX_NAME ?? 'indexName',
facetFilters: process.env.ALGOLIA_DOCSEARCH_FACET_FILTERS ?? ''
},
}
While I was not able to see them there.
I will talk to the Content guys about it.
@Baroshem
I noticed that "userOptions" doesn't work as expected, so I hard-coded the data, and now you can click on the search engine but when typing, this error appears:
It seems that the variables were not properly set as I have explained above :)
Let's wait for the content guys response
I solved this problem, useRuntimeConfig()
contains an object, "public", just refer to it
https://github.com/nuxt-themes/docus/blob/f56cd8d66441f7a60ad19a8644656c925f9f1747/app/integrations/docsearch.ts#L23
from:
const { algolia } = useRuntimeConfig()
to:
const { algolia } = useRuntimeConfig().public
Ok thanks for letting me know about the result :)
Version
@nuxtjs/algolia: ^1.3.1 nuxt: ^3.5.2
Reproduction Link
https://content.nuxtjs.org/
Steps to reproduce
Use docus docsearch.ts: https://github.com/nuxt-themes/docus/blob/f56cd8d66441f7a60ad19a8644656c925f9f1747/app/integrations/docsearch.ts#L4
What is Expected?
Working search engine
What is actually happening?
When click: