[Question]: <title>Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
Do you need to ask a question?
- [ ] I have searched the existing question and discussions and this question is not already answered.
- [ ] I believe this is a legitimate question, not just a bug or feature request.
Your Question
Can anyone tell me why webui is getting an error
Additional Context
虽然不清楚为啥会出现这个问题,但是解法如下:修改.venv\Lib\site-packages\lightrag\lightrag.py,476行
class NoCacheStaticFiles(StaticFiles): async def get_response(self, path: str, scope): response = await super().get_response(path, scope) if path.endswith(".js"): response.headers["Content-Type"] = "application/javascript" if path.endswith(".html"): response.headers["Cache-Control"] = ( "no-cache, no-store, must-revalidate" ) response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "0" return response
添加 if path.endswith(".js"): response.headers["Content-Type"] = "application/javascript"就行了,记得清空浏览器缓存
Try the latest version pls.