docusaurus-search-local
docusaurus-search-local copied to clipboard
After build "Couldn't Found search-index.json" error shows.
Same here. Using: Node 16.18.1 and Docusaurus 2.3.1 Any idea how it could be fixed?
Same issue here:
GET http://localhost:3000/search-index.json 404 (Not Found)
Hello, same here with Docusaurus 2.4.0.
"easyops-cn/docusaurus-search-local" integrated in theme.
After successful build, no search-index.json
file generated inside build
directory.
Then, searching fails with error 404.
Same issue for Docusaurus v2.4.0, search-index.json is not generated after build.
This PR and its deploy preview generated by renovate bot shows it's working with Docusaurus v2.4.0.
Can anyone facing this issue, provide a repro link?
I was able to narrow the issue down to having routeBasePath: '/'
set in @docusaurus/preset-classic
config, but also needed to set docsRouteBasePath: '/',
to match since I'm running in docs only mode. No more issue after setting that option in the docusaurus-search-local
themes config.
我能够将问题缩小到
routeBasePath: '/'
在配置中进行设置@docusaurus/preset-classic
,但还需要设置docsRouteBasePath: '/',
匹配,因为我在仅文档模式下运行。在主题配置中设置该选项后没有更多问题docusaurus-search-local
。
Thanks, this tip solved my problem
I was able to narrow the issue down to having
routeBasePath: '/'
set in@docusaurus/preset-classic
config, but also needed to setdocsRouteBasePath: '/',
to match since I'm running in docs only mode. No more issue after setting that option in thedocusaurus-search-local
themes config.
Thanks, this solved my issue
@jon-price-visiontree @pawhan11 can you please attach snippet of the implementation here ?
@kaushal0107 sure, hope this helps :)
Using routeBasePath
in @docusaurus/preset-classic
config:
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
...
},
}),
],
],
Using docusaurus-search-local
themes config: See description
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
{
docsRouteBasePath: '/',
...
},
],
],