TypeError: Can not get Prototype on non ECMA Object HarmonyOS 鸿蒙Next

发布于 1周前 作者 vueper 最后一次编辑是 5天前 来自 鸿蒙OS

TypeError: Can not get Prototype on non ECMA Object HarmonyOS 鸿蒙Next

04-03 09:39:09.713 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict][default] Call:2172 occur exception need return
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict][ecmascript] Pending exception before ExecutePendingJob called, in line:3462, exception details as follows:
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict]TypeError: Can not get Prototype on non ECMA Object
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at scopedTrace (/usr1/hmos_forsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:1837:1837)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at viewPropertyHasChanged (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5377:5377)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at notifyPropertyHasChangedPU (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3637:3637)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at syncPeerHasChanged (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:4567:4567)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at anonymous (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3647:3647)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at notifyPropertyHasChangedPU (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3644:3644)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at syncPeerHasChanged (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:4186:4186)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at anonymous (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3647:3647)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at notifyPropertyHasChangedPU (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3644:3644)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at notifyObjectValueAssignment (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:3435:3435)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at set (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:4030:4030)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at reset (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:4275:4275)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at updateStateVars (business/market/paramChart/src/main/ets/views/fiveday/FiveDayAuxiliaryParamView.ets:79:9)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at updateStateVarsOfChildByElmtId (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5370:5370)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at anonymous (business/market/stockDetail/src/main/ets/view/fiveday/FiveDayChartContainer.ets:561:33)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at updateFunc (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5619:5619)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at UpdateElement (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5299:5299)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at anonymous (/usr1/hmosforsystem/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5529:5529)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at updateDirtyElements (/usr1/hmosfor_system/src/increment/sourcecode/foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/engine/stateMgmt.js:5524:5524)
04-03 09:39:09.714 40301-40301 C03F00/ArkCompiler com.pingan.securities E [nodict] at rerender (business/market/stockDetail/src/main/ets/view/fiveday/FiveDayChartContainer.ets:668:9)
04-03 09:39:11.107 40301-40391 A00101/lib_log_jni com.pingan.securities D ---------timeTick-------name is-----SSL

re>

似乎刷新重绘的时候出现的问题,日志显示的代码行对不上;想咨询下这种异常会是什么原因导致的?


更多关于TypeError: Can not get Prototype on non ECMA Object HarmonyOS 鸿蒙Next的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

Can not get Prototype on non ECMA Object 常见场景是发生在napi_value生存期,原因可能是napi_value超出NAPI框架的scope,定位的话可以根据崩溃栈反编译找到出现问题的napi接口的上层接口,在上层接口内找到出问题的napi_value,检查napi_value的使用范围是否超出了napi_handle_scope的作用域范围。按这种方式重新试一下定位问题。

更多关于TypeError: Can not get Prototype on non ECMA Object HarmonyOS 鸿蒙Next的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


在HarmonyOS鸿蒙Next环境中遇到“TypeError: Can not get Prototype on non ECMA Object”错误,通常表明你试图在一个非ECMAScript对象上访问其原型(Prototype)。这种错误可能由以下几种情况引起:

  1. 对象类型不匹配:你尝试对一个原生(非JavaScript)对象执行ECMAScript对象的操作。在鸿蒙系统中,某些API或模块返回的对象可能并非标准的ECMAScript对象。

  2. API使用不当:在调用鸿蒙API时,可能误用了返回的对象,比如尝试在一个不支持Prototype属性的对象上调用相关方法。

  3. 环境差异:鸿蒙系统的JavaScript环境可能与标准的浏览器环境有所不同,导致某些在浏览器中可行的操作在鸿蒙环境中不可行。

针对此错误,你需要检查引发问题的对象来源,确认其是否为ECMAScript对象。如果是鸿蒙API返回的对象,请查阅相关文档,确认该对象是否支持Prototype操作。此外,确保你的代码逻辑符合鸿蒙系统的运行规则。

如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html

回到顶部