From 4ac522ffc609868d05cfce7734ba2f3dd332dbf8 Mon Sep 17 00:00:00 2001 From: yczpf2019 Date: Sat, 24 Jan 2026 20:55:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(websocket-bu):=20=E4=BF=AE=E5=A4=8D=20WebBU?= =?UTF-8?q?=20=E6=A8=A1=E5=9D=97=E5=8A=A0=E8=BD=BD=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=94=B9=E4=B8=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/modules/mixly-modules/web-socket/burn-upload.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mixly/common/modules/mixly-modules/web-socket/burn-upload.js b/mixly/common/modules/mixly-modules/web-socket/burn-upload.js index d6937575..4c94cb52 100644 --- a/mixly/common/modules/mixly-modules/web-socket/burn-upload.js +++ b/mixly/common/modules/mixly-modules/web-socket/burn-upload.js @@ -31,8 +31,8 @@ goog.loadJs('web', () => { const { SELECTED_BOARD, BOARD } = Config; - // 引入本地 Web.BU 模块,用于 MicroPython 本地上传 - const WebBU = Mixly.Web?.BU; + // WebBU 需要在使用时动态获取,避免模块加载顺序问题 + const getWebBU = () => Mixly.Web?.BU; const { Serial } = WebSocket; @@ -74,6 +74,7 @@ goog.loadJs('web', () => { this.initBurn = function () { // MicroPython 板卡使用本地 Web Serial API 烧录,而非通过服务器 + const WebBU = getWebBU(); if (SELECTED_BOARD?.language === 'MicroPython' && WebBU) { return WebBU.initBurn(); } @@ -111,6 +112,7 @@ goog.loadJs('web', () => { this.initUpload = function () { // MicroPython 板卡使用本地 Web Serial API 上传,而非通过服务器 + const WebBU = getWebBU(); if (SELECTED_BOARD?.language === 'MicroPython' && WebBU) { return WebBU.initUpload(); }