searchPro中文检索报错
大约 1 分钟
searchPro 中文检索报错
使用 vuepress-theme-hope
主题开发时,使用 vuepress-plugin-search-pro
作为搜索插件。
问题描述
问题已提交到GitHub
Checklist
Package name
vuepress-theme-hope
Which operating system are you using?
Describe the bug
使用文档提供的命令创建项目后,在 theme.ts
中的 searchPro 配置 indexContent: true
时,搜索中文会导致页面报错,但 config.ts
中配置则可以正常搜索
pnpm create vuepress-theme-hope my-docs
pnpm add -D vuepress-plugin-search-pro
// theme.ts
export default hopeTheme({
plugins: {
searchPro: {
indexContent: true;
}
}
})
这是在 theme.ts
中配置后搜索出现的错误
// config.ts
import { searchProPlugin } from 'vuepress-plugin-search-pro';
export default defineUserConfig({
plugins: [
searchProPlugin({
indexContent: true,
}),
],
});
这是在 config.ts
中配置的搜索成功
Additional context
开发环境:
- node v18.20.3
- npm 10.7.0
- pnpm 9.4.0
项目依赖版本
- "@vuepress/bundler-vite": "2.0.0-rc.14",
- "vue": "^3.4.27",
- "vuepress": "2.0.0-rc.14",
- "vuepress-plugin-search-pro": "2.0.0-rc.50",
- "vuepress-theme-hope": "2.0.0-rc.50"