Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

离线部署成功后,webui页面正常启动,docs文档不能加载出来

Open guoxiaoyue111111 opened this issue 10 months ago • 2 comments

您好,离线部署了langchain-0.2.10版本,服务启动正常,如下: 4eb4fe92c078e350ef8f01d8cdd7339

但是访问http://10.247.22.3:8080/docs,页面显示如下: 18aee41e31e5c511275cf25cea4e672

前端界面为: bd9fa1d00898f2a8f18da51f5e7460f

请问,这种情况的原因是什么?

guoxiaoyue111111 avatar Apr 02 '24 06:04 guoxiaoyue111111

Hey there, @guoxiaoyue111111! Great to see you diving into Langchain-Chatchat v0.2.10. Let's tackle these issues together.

Based on the issues you've described, it seems like there are two main problems: the documentation not loading at http://10.247.22.3:8080/docs and the frontend rendering error displaying "Could not render Y/n, see the console".

For the first issue, there are a few potential causes. One possibility is that the static files required for offline documentation (swagger-ui-bundle.js, swagger-ui.css, redoc.standalone.js, etc.) are missing or not correctly placed in the static directory specified in the MakeFastAPIOffline function. Another possibility is that there might be an issue with the routing setup in MakeFastAPIOffline, where the routes for documentation are not correctly removed or added back with the custom handlers. Lastly, the server might not be correctly configured to serve static files, or there could be a permissions issue with accessing the static files directory.

For the second issue, the error message suggests a problem with rendering a component or data on the frontend. This could be due to the frontend application expecting a specific format or data structure from the backend, which is not being met. Alternatively, there could be a JavaScript error in the frontend code that prevents it from rendering correctly. The message suggests checking the console for more details, which could provide insights into what went wrong.

There are a few similar issues that have been reported in the Langchain-Chatchat repository. For example, issue #2823 suggests downloading the swagger-ui.css and swagger-ui-bundle.js files from the official Swagger repository and replacing the corresponding files in the server/static directory of the service. After doing this, you should restart the project and disable cache in your browser's developer tools.

Issue #2812 suggests reverting the source code of '/server/static/swagger-ui-bundle.js' back to the previous version. This seemed to have resolved the issue for a user.

Lastly, issue #2070 suggests that the problem might be similar to issue #2178, and that pressing enter might resolve the issue.

I hope this helps! If you have any more information or if these solutions don't work, please let me know.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Apr 02 '24 06:04 dosubot[bot]

这个问题已经被标记为 stale ,因为它已经超过 30 天没有任何活动。

github-actions[bot] avatar May 03 '24 21:05 github-actions[bot]

一样的问题,楼主解决了吗,可以分享下吗

LGY-111 avatar Aug 21 '24 12:08 LGY-111

我的chrome版本比较老,浏览器console报错TypeError: Object.hasOwn is not a function。这个函数是es2022的新特性,93以前的版本不兼容。在swagger-ui-bundle.js中增加一行解决了:

if (!Object.hasOwn){Object.hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);}

ref: https://github.com/remarkjs/react-markdown/issues/772

umbraclet16 avatar Aug 27 '24 09:08 umbraclet16