You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module not found: Error: Can't resolve '@easyops-cn/docusaurus-search-local/dist/client/shared/lunrLanguageZh' in 'C:\Users\admin\Documents\Projects\website.docusaurus@easyops-cn\docusaurus-search-local\default'
我的项目结构是 将
@easyops-cn/docusaurus-search-local
作为pnpm workspacepackages/preset
的一个依赖,然后将package/preset
通过workspace协议链接到项目根目录中使用根目录是用create-docusaurus 创建的一个网站
在根目录运行docusaurus start报错如下:
Module not found: Error: Can't resolve '@easyops-cn/docusaurus-search-local/dist/client/shared/lunrLanguageZh' in 'C:\Users\admin\Documents\Projects\website.docusaurus@easyops-cn\docusaurus-search-local\default'
检查后发现
.docusaurus\@easyops-cn\docusaurus-search-local\default\generated.js
中的内容报错原因在第三行,因为pnpm特殊的node_modules结构,这个模块在主项目中无法直接引入
第二行没报错,可以考虑将导入方式也统一换成绝对链接
对应的源代码在
docusaurus-search-local/src/server/utils/generate.ts
第53行,改成编译了一下没发现问题,但是暂时没法在我的网站上测试,能否帮忙修复一下 ,谢谢
The text was updated successfully, but these errors were encountered: