pgadmin 4 v4.28 不断加载
pgadmin 4 v4.28 keeps loading
我安装了 pgadmin 4 v4.28,它一直在加载但打不开,我尝试以管理员身份打开它,但它仍然打不开。我以前有旧版本,但在安装上述版本之前我已经正确删除了 PostgreSQL DB 和 pg admin。你们能帮我解决这个问题吗? link 我有问题的截图。
执行以下步骤解决此问题:
- 打开注册表编辑器。
- 将 HKEY_CLASSES_ROOT\.js\Content 类型的值从 text/plain 更改为 text/javascript.
- 重新启动 pgadmin 服务器。您可以通过从任务管理器中结束 pgadmin 后台任务来完成此操作。
我在 windows 10 上使用 Chrome 浏览器时遇到了与 pgAdmin 4.28 相同的问题。切换到 Edge 浏览器后它开始工作了。
更新的答案
PGAdmin 已将其跟踪为 bug 5996. In it, they recommend the following solution:
You can add the following lines to the "config_distro.py" and
restart the pgAdmin 4 server:
import mimetypes
mimetypes.add_type('text/javascript', '.js')
The above workaround should work for you.
他们还提到:
In the next release, we're looking to include that into the code, so
users don't have to do it themselves.
But the answer to your question, the config_distro.py
can be overwritten
in the subsequent upgrades.
pgAdmin does provide another option to set the settings in the
config_system.py file which is intended for system administrator to
include settings and which is outside of the pgAdmin installation.
Please refer https://www.pgadmin.org/docs/pgadmin4/4.28/config_py.html
for more details.
上一个答案
另一个回答有评论问是什么原因造成的this/how作者想通了
为了后代,这被记录在案 in the FAQ:
When I launch pgAdmin 4 v4.28 or later on Windows, the loading page
never closes. Why?
pgAdmin 4 v4.28 includes additional security features, one of which is
intended to prevent security issues caused by Content Sniffing.
Unfortunately some Windows systems are misconfigured such that this
causes Javascripts used by pgAdmin to fail to load. Opening the
developer tools on your browser will show an error similar to this:
> Refused to execute script from
> 'http://127.0.0.1:57313/static/vendor/require/require.min.js?ver=42800'
> because its MIME type ('text/plain') is not executable, and strict
> MIME type checking is enabled.
>
> (index):39 Uncaught ReferenceError: require is not defined at
> (index):39
This will occur when the value of the registry key at
HKEY_CLASSES_ROOT\.js\Content Type is set to text/plain. To resolve
the issue, use the Registry Editor and reset the value of
HKEY_CLASSES_ROOT\.js\Content Type to:
text/javascript
Finally, restart the pgAdmin server.
有趣的是,GoLang, TensorBoard, Django 和许多其他人都针对同一问题提交了问题。浏览器拒绝加载内容,因为浏览器认为它正在根据注册表配置传输为 'text/plain'。
您还可以降级您的 PgAdmin。我不想更改注册表编辑器中的任何内容。所以我下载并安装了pgadmin4-3.6
。它在 Windows 10 (x64) 上运行良好。
2022 年 5 月 25 日编辑(pgadmin4 下载的新 Link)
你们都有很好的答案......但是根据我刚刚的经验,最简单的方法,立即对我有用的是install the new version of pgadmin4,而不必卸载现有的。
这就是我所做的,我仍然能够看到我所有的数据库和表都没有改变和未经调和。
只需运行安装即可
我刚刚将 PG Admin 从 v4.28 升级到 V4.29,它解决了我的问题。 Mac.
可以从 here for Linux, here for Windows and here 下载最新版本
这与vialy的推荐类似。感谢 Vialy 的输入,它拯救了我的一天...:)
我安装了 pgadmin 4 v4.28,它一直在加载但打不开,我尝试以管理员身份打开它,但它仍然打不开。我以前有旧版本,但在安装上述版本之前我已经正确删除了 PostgreSQL DB 和 pg admin。你们能帮我解决这个问题吗? link 我有问题的截图。
执行以下步骤解决此问题:
- 打开注册表编辑器。
- 将 HKEY_CLASSES_ROOT\.js\Content 类型的值从 text/plain 更改为 text/javascript.
- 重新启动 pgadmin 服务器。您可以通过从任务管理器中结束 pgadmin 后台任务来完成此操作。
我在 windows 10 上使用 Chrome 浏览器时遇到了与 pgAdmin 4.28 相同的问题。切换到 Edge 浏览器后它开始工作了。
更新的答案
PGAdmin 已将其跟踪为 bug 5996. In it, they recommend the following solution:
You can add the following lines to the "config_distro.py" and restart the pgAdmin 4 server:
import mimetypes mimetypes.add_type('text/javascript', '.js')
The above workaround should work for you.
他们还提到:
In the next release, we're looking to include that into the code, so users don't have to do it themselves.
But the answer to your question, the
config_distro.py
can be overwritten in the subsequent upgrades.pgAdmin does provide another option to set the settings in the config_system.py file which is intended for system administrator to include settings and which is outside of the pgAdmin installation. Please refer https://www.pgadmin.org/docs/pgadmin4/4.28/config_py.html for more details.
上一个答案
另一个回答有评论问是什么原因造成的this/how作者想通了
为了后代,这被记录在案 in the FAQ:
When I launch pgAdmin 4 v4.28 or later on Windows, the loading page never closes. Why?
pgAdmin 4 v4.28 includes additional security features, one of which is intended to prevent security issues caused by Content Sniffing.
Unfortunately some Windows systems are misconfigured such that this causes Javascripts used by pgAdmin to fail to load. Opening the developer tools on your browser will show an error similar to this:
> Refused to execute script from
> 'http://127.0.0.1:57313/static/vendor/require/require.min.js?ver=42800'
> because its MIME type ('text/plain') is not executable, and strict
> MIME type checking is enabled.
>
> (index):39 Uncaught ReferenceError: require is not defined at
> (index):39
This will occur when the value of the registry key at HKEY_CLASSES_ROOT\.js\Content Type is set to text/plain. To resolve the issue, use the Registry Editor and reset the value of HKEY_CLASSES_ROOT\.js\Content Type to:
text/javascript
Finally, restart the pgAdmin server.
有趣的是,GoLang, TensorBoard, Django 和许多其他人都针对同一问题提交了问题。浏览器拒绝加载内容,因为浏览器认为它正在根据注册表配置传输为 'text/plain'。
您还可以降级您的 PgAdmin。我不想更改注册表编辑器中的任何内容。所以我下载并安装了pgadmin4-3.6
。它在 Windows 10 (x64) 上运行良好。
2022 年 5 月 25 日编辑(pgadmin4 下载的新 Link)
你们都有很好的答案......但是根据我刚刚的经验,最简单的方法,立即对我有用的是install the new version of pgadmin4,而不必卸载现有的。
这就是我所做的,我仍然能够看到我所有的数据库和表都没有改变和未经调和。
只需运行安装即可
我刚刚将 PG Admin 从 v4.28 升级到 V4.29,它解决了我的问题。 Mac.
可以从 here for Linux, here for Windows and here 下载最新版本这与vialy的推荐类似。感谢 Vialy 的输入,它拯救了我的一天...:)