dcloudio/uni-app

uni-app x 运行到微信小程序控制台报错: UTSJSONObject is not defined

Closed this issue · 7 comments

c1uan commented

Bug 描述

app.js错误:\n [⁠ReferenceError⁠] UTSJSONObject is not defined

版本

  • HBX: 4.7.6
  • 微信开发者工具:Stable 1.06.2504050, 调试基础库:3.10.3

复现步骤

  1. 新建uniappx,不使用云服务
  2. 直接运行到微信小程序
2025-10-25.13-51-12.00_00_00-00_00_33.mp4
2025-10-25.13-51-12.00_01_58-.mp4

预期结果

No response

实际结果

13:53:14.835 ready in 95296ms.
13:53:32.147 app.js错误:\n [⁠ReferenceError⁠] UTSJSONObject is not defined
13:53:32.147 Page "pages/index/index" has not been registered yet.
13:53:32.180 MiniProgramError
13:53:32.180 UTSJSONObject is not defined
13:53:32.180 ReferenceError: UTSJSONObject is not defined
13:53:32.180 at http://127.0.0.1:45500/appservice/app.js:11:51
13:53:32.180 at http://127.0.0.1:45500/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:496849
13:53:32.180 at f.runWith (http://127.0.0.1:45500/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:486430)
13:53:32.180 at q (http://127.0.0.1:45500/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:496827)
13:53:32.180 at ide:///package/APP/appservice.js:7:9
13:53:32.180 at doWhenAllScriptLoaded (ide:///getmainpackage.js:1158:21)
13:53:32.180 at Object.scriptLoaded (ide:///getmainpackage.js:1193:5)
13:53:32.180 at Object. (ide:///getmainpackage.js:1251:22)

我也遇到了一样的问题,只有 uniapp x 的项目存在。
最近正在开发的小程序,软件环境都没有变化,为什么突然会出现这个问题,导致无法在微信开发者工具中调试。

macOS
Hbuilder X 版本:4.76(ARM)
微信开发者工具 当前已是最新版本(1.06.2504050 darwin-arm64)

22:18:10.119 MiniProgramError
22:18:10.119 UTSJSONObject is not defined
22:18:10.119 ReferenceError: UTSJSONObject is not defined
22:18:10.120 at http://127.0.0.1:41490/appservice/app.js:11:51
22:18:10.120 at http://127.0.0.1:41490/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:496849
22:18:10.120 at f.runWith (http://127.0.0.1:41490/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:486430)
22:18:10.120 at q (http://127.0.0.1:41490/appservice/__dev__/WASubContext.js?t=wechat&v=3.10.3:1:496827)
22:18:10.120 at ide:///package/APP/appservice.js:7:9
22:18:10.120 at doWhenAllScriptLoaded (ide:///getmainpackage.js:1158:21)
22:18:10.120 at Object.scriptLoaded (ide:///getmainpackage.js:1193:5)
22:18:10.120 at Object. (ide:///getmainpackage.js:1251:22)
22:18:10.120 Page "pages/index/index" has not been registered yet.
22:18:52.871 app.js错误:\n [⁠ReferenceError⁠] UTSJSONObject is not defined

问题产生的原因是最新版本的微信开发者工具影响力global的表现,开发者工具可先回退到之前的版本

c1uan commented

问题产生的原因是最新版本的微信开发者工具影响力global的表现,开发者工具可先回退到之前的版本

已回退至1.06.2412050,问题解决了,感谢

我弄这个弄了两天时间,感谢

通过版本升级微信开发工具,到 2.x 解决

awt135 commented

00:24:42.114 MiniProgramError
00:24:42.114 UTSJSONObject is not defined
00:24:42.114 ReferenceError: UTSJSONObject is not defined

我也是,搞了好久。找不到原因。原来如此。

微信开发者工具 1.x 最新版已修复此问题,可升级到最新版,详见