Skip to content

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

Closed

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

Activity

  1. q792602257 commented on Jan 19, 2026

    @q792602257
    Contributor

    实际上nginx+https反代还会有一个问题:Label Studio无法打开

    原因:this code ,在没有端口的时候(即不带端口访问https的时候),window.location.port === ""空字符串,空字符串+1等于字符串1,所以不会报错,会尝试打开:http://your.domain:1来访问Label Studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions