vue.js - Chromium headless 页面无响应但可在 Firefox 上运行

标签 vue.js ubuntu raspberry-pi chromium

我在使用 Ubuntu 20 的 Raspberry Pi 模型 4B 上 headless 运行 Chromium 时遇到问题。为了显示浏览器,我使用的是官方的 Raspberry Pi 触摸屏。
问题是本地托管页面未加载,并且显示“页面无响应”。但是,如果我按下“退出页面”按钮,然后按下“重新加载”按钮,它就会开始正常工作。
我正在使用以下命令来启动 Chromium:xinit /usr/bin/sh -c "chromium-browser --kiosk 127.0.0.1:5000" .如果我运行相同的命令,但使用 firefox而不是 chromium-browser ,页面有效。我不想使用 Firefox,因为它在 headless 模式下还有其他一些问题。这就是为什么我得出结论,问题不在于网页,而在于 Chrome 。
我尝试使用 npm run serve 托管网页和 python3 -m http.server 5000但总是遇到同样的问题。
我不知道这是否重要,但是在使用上述命令运行 chromium-browser 时收到以下错误消息:

[18281:18281:1203/112557.242527:ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18281:18281:1203/112557.243222:ERROR:gl_surface_egl.cc(782)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18281:18281:1203/112557.243611:ERROR:gl_surface_egl.cc(1382)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[18281:18281:1203/112557.244683:ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18281:18281:1203/112557.244958:ERROR:gl_surface_egl.cc(782)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18281:18281:1203/112557.245153:ERROR:gl_surface_egl.cc(1382)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[18281:18281:1203/112557.245355:ERROR:gl_ozone_egl.cc(20)] GLSurfaceEGL::InitializeOneOff failed.
[18281:18281:1203/112557.312801:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
[18324:18324:1203/112557.722696:ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18324:18324:1203/112557.724405:ERROR:gl_surface_egl.cc(782)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18324:18324:1203/112557.725290:ERROR:gl_surface_egl.cc(1382)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[18324:18324:1203/112557.727887:ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 12289: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18324:18324:1203/112557.728730:ERROR:gl_surface_egl.cc(782)] EGL Driver message (Critical) eglInitialize: Could not dlopen libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
[18324:18324:1203/112557.729189:ERROR:gl_surface_egl.cc(1382)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[18324:18324:1203/112557.729615:ERROR:gl_ozone_egl.cc(20)] GLSurfaceEGL::InitializeOneOff failed.
[18324:18324:1203/112557.794755:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
[18345:18345:1203/112557.868079:ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1048.
[18345:18345:1203/112557.868777:ERROR:gl_surface_egl.cc(782)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1048.
[18345:18345:1203/112557.869337:ERROR:gl_surface_egl.cc(1382)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[18345:18345:1203/112557.869934:ERROR:gl_ozone_egl.cc(20)] GLSurfaceEGL::InitializeOneOff failed.
[18345:18345:1203/112557.928770:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
[18353:18353:1203/112557.961644:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is
[18072:18265:1203/112602.637067:ERROR:chrome_browser_main_extra_parts_metrics.cc(226)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
[18072:18265:1203/112602.637684:ERROR:chrome_browser_main_extra_parts_metrics.cc(229)] crbug.com/1216328: Checking Bluetooth availability ended.
[18072:18265:1203/112602.637924:ERROR:chrome_browser_main_extra_parts_metrics.cc(232)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
[18072:18265:1203/112602.833205:ERROR:chrome_browser_main_extra_parts_metrics.cc(236)] crbug.com/1216328: Checking default browser status ended.
此外,如果我使用此命令运行其他网页,例如 google.com,我会收到相同的错误消息,但网页显示没有问题。
网页是用 Vue.js 编写的

最佳答案

我通过禁用硬件加速解决了这个问题。我这样做是因为我在这里发现了一个类似的问题:https://unix.stackexchange.com/questions/344138/chromium-google-maps-issue
我通过添加 --disable-gpu 来做到这一点标记到命令。

关于vue.js - Chromium headless 页面无响应但可在 Firefox 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70213741/

相关文章:

javascript - Vue JS 渲染大括号而不是结果

ubuntu - .Net 核心 sdk 在 ubuntu 18.10

python-3.x - 带有步进电机代码的运行时警告

python - 在 Raspberry Pi 3 Stretch 上将默认 Python 3.5.3 升级到 Python 3.7.2

c# - .NET Core - HTTPClient - Ubuntu 20.04 上的 dh key 太小

Python 脚本在库示例文件夹中有效,但在父目录中无效

javascript - 返回距离现在最近的时间的项目 JavaScript/Moment.js

javascript - 如何正确使用 v-if 和 v-for 嵌套对象 vue js

javascript - 导出 2 webpack 配置常量

ubuntu - 无法在jetson agx xavier上安装anaconda