From d08497ef3b6f1cdc620a1e705c89088bad8d6444 Mon Sep 17 00:00:00 2001 From: min Date: Sat, 6 Jun 2026 11:56:34 +0300 Subject: [PATCH] =?UTF-8?q?fix(player):=20scene.setLabel=20=E2=80=94=20imp?= =?UTF-8?q?ort=20LabelManager=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20req?= =?UTF-8?q?uire=20(require=20=D0=BA=D1=80=D0=B0=D1=88=D0=B8=D1=82=20=D0=B2?= =?UTF-8?q?=20=D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ReferenceError: require is not defined при game.self.setLabel/scene.setLabel в плеере. Заменён require('./LabelManager') на статический import (как в студии). Co-Authored-By: Claude Opus 4.8 --- src/engine/GameRuntime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/GameRuntime.js b/src/engine/GameRuntime.js index 4f1452f..fcb7942 100644 --- a/src/engine/GameRuntime.js +++ b/src/engine/GameRuntime.js @@ -17,6 +17,7 @@ import { Color3 } from '@babylonjs/core'; import { ScriptSandbox } from './ScriptSandbox'; import { STORYS_addres } from '../api/API'; +import { LabelManager } from './LabelManager'; // задача: scene.setLabel (require крашит в браузере) export class GameRuntime { constructor(scene3d) { @@ -2767,7 +2768,6 @@ export class GameRuntime { if (typeof ref !== 'string') return; // ленивое создание менеджера меток if (!this.scene3d._labelManager) { - const { LabelManager } = require('./LabelManager'); this.scene3d._labelManager = new LabelManager(this.scene3d.scene); } const lm = this.scene3d._labelManager;