欢迎访问 生活随笔!

凯发k8官方网

当前位置: 凯发k8官方网 > 前端技术 > html >内容正文

html

pgadmin启动时浏览器页面一直转圈圈 无法正常打开页面 -凯发k8官方网

发布时间:2025/1/21 html 15 豆豆
凯发k8官方网 收集整理的这篇文章主要介绍了 pgadmin启动时浏览器页面一直转圈圈 无法正常打开页面 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

最近新安装了 postgres,同时安装了 pgadmin 4,但是遇到了无法启动的问题。


问题描述:

打开 pgadmin 4 ,弹出浏览器页面时一直处于转圈圈加载的页面

使用浏览器开发者工具检查,发现报错信息

refused to execute script from 'http://127.0.0.1:54943/static/vendor/require/require.min.js?ver=42800' because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.

refused to execute script from 'http://127.0.0.1:54943/static/js/generated/vendor.main.js?ver=42800' because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.

refused to execute script from 'http://127.0.0.1:54943/static/js/generated/vendor.others.js?ver=42800' because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.

refused to execute script from 'http://127.0.0.1:54943/static/js/generated/pgadmin_commons.js?ver=42800' because its mime type ('text/plain') is not executable, and strict mime type checking is enabled.





凯发k8官方网的解决方案:

从报错信息可以看出,浏览器没有将 require.min.js、vendor.main.js、vendor.others.js、pgadmin_commons.js 这几个文件解释为 javascript,所以无法执行这些脚本,他们的响应头里面 content-type 是 text/plain。可能是因为 注册表被破坏,把扩展名为 js 的文件类型注册为 ‘text/plain’



方法一:

打开注册表: 计算机\hkey_classes_root\.js\

修改 content type 选项的配置,将 text/plain 修改为 text/javascriptapplication/javascript



方法二:

修改 postgres 安装目录/pgadmin 4/web 路径下的 config.py 文件

在文件末尾添加

import mimetypes mimetypes.add_type('application/javascript', '.js')



方法三:

修改 postgres 安装目录/pgadmin 4/web 路径下的 config.py 文件 第179行

x_content_type_options = “nosniff” 修改为 x_content_type_options = ""



在方法二、三中,文本编辑器没有用管理员模式运行的话,无法直接保存对 config.py 文件的修改,可以考虑

  • 先用管理员模式运行文本编辑器,然后在编辑器里面打开该文件
  • 将该文件复制到其他路径,修改后再替换回该目录



最后,在右下角托盘右击 pgadmin 4 图标,shut down server,再重新打开 pgadmin 4



我的小站、github、csdn


总结

以上是凯发k8官方网为你收集整理的pgadmin启动时浏览器页面一直转圈圈 无法正常打开页面的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得凯发k8官方网网站内容还不错,欢迎将凯发k8官方网推荐给好友。

  • 上一篇:
  • 下一篇:
网站地图