Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[问题]: 本地开发启动后拖入pdf文件报错 #650

Closed
magicdmer opened this issue Jan 5, 2025 · 3 comments
Closed

[问题]: 本地开发启动后拖入pdf文件报错 #650

magicdmer opened this issue Jan 5, 2025 · 3 comments
Assignees

Comments

@magicdmer
Copy link
Collaborator

您的问题

我今天fork了仓库在win11上进行本地开发,然后成功yarn dev运行起来,接着我打开知识库,配置好后,拖入pdf,报错:

Error invoking remote method 'knowledge-base:add': Error: Could not dynamically require "./pdf.js/v1.10.100/build/pdf.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.

然后我检查了一下工程下的node_modules文件夹,可以找到 pdf-parse\lib\pdf.js\v1.10.100\build\pdf.js 文件,路径也没错。麻烦问一下可能是啥原因

相关背景

No response

补充信息

No response

优先级

低 (有空再看)

@magicdmer
Copy link
Collaborator Author

我换了一个环境,一切又正常了,应该是yarn的版本问题。之前环境yarn用的是1.x的,正常环境是yarn 4.5 的。

@kangfenmao
Copy link
Collaborator

昨天看到了,准备今天回你呢,你已经解决了

@magicdmer
Copy link
Collaborator Author

昨天看到了,准备今天回你呢,你已经解决了

运气好,哈哈,今天上班用公司电脑正好是yarn 4.5 全程没有家里各种乱七八糟的问题,对比了一下应该和yarn版本有关。node也有区别,公司是v18,家里是v20,不过应该和这个关系不大

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants