Langchain-Chatchat
Langchain-Chatchat copied to clipboard
离线部署成功后,webui页面正常启动,docs文档不能加载出来
您好,离线部署了langchain-0.2.10版本,服务启动正常,如下:
但是访问http://10.247.22.3:8080/docs,页面显示如下:
前端界面为:
请问,这种情况的原因是什么?
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
- v0.2.10版本部署之后。前端7861/docs的接口文档不可用,前端报错。有遇到这个问题吗
- [BUG] v0.2.10版本启动一切正常,但api文档访问报错 "GET /static-offline-docs/swagger-ui.css.map HTTP/1.1" 404 Not Found
- startup一键启动,应该是成功了。但是只能访问FastAPI Docs 界面,WEB UI界面打不开。
- server/utils.py
- startup.py
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.
这个问题已经被标记为 stale
,因为它已经超过 30 天没有任何活动。
一样的问题,楼主解决了吗,可以分享下吗
我的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