html
pgadmin启动时浏览器页面一直转圈圈 无法正常打开页面 -凯发ag旗舰厅登录网址下载
最近新安装了 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.
凯发ag旗舰厅登录网址下载的解决方案:
从报错信息可以看出,浏览器没有将 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/javascript 或 application/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
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的pgadmin启动时浏览器页面一直转圈圈 无法正常打开页面的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: