Skip to content

非局域网访问,前端控制台报错,页面无法加载 #263

Description

@Dallas98

自v0.2.0:

index-ByhVzKOq.js:5924
Uncaught TypeError: Cannot read properties of undefined (reading 'VERTEX') at index-ByhVzKOq.js:5924:22856
(匿名)@index-ByhVzKOq.js:5924

原因:引入了three.js支撑知识图谱前端渲染
在现代浏览器中,许多高性能 API(如 WebGPU、某些 WebGL 扩展、SharedArrayBuffer 等)被限制在“安全上下文”中。如果你的线上环境是通过 HTTP 访问的,浏览器会直接禁用这些功能,导致相关库(如 Three.js 的 Node 系统)初始化失败,变量变成 undefined。

临时绕过方案

可以尝试以下操作:

  1. 打开 Chrome 浏览器。
  2. 访问 chrome://flags/#unsafely-treat-insecure-origin-as-secure。
  3. 将你的线上 HTTP 地址填入框中。
  4. 重启浏览器再访问。

https://docs.google.com/document/d/1SUPAfloMFS3EFbxR0iB8rE7C9OzQ7W8o0hxqBuIJzL8/edit?pli=1&tab=t.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions