小明子
小明子
  • 发布:2019-10-10 17:50
  • 更新:2020-05-21 10:15
  • 阅读:6171

HBuilderX控制台报错,如何定位错误?

分类:HBuilderX

17:46:41.961 [JS Framework] Failed to execute the callback function:
17:46:41.982 TypeError: undefined is not an object (evaluating 'e[0].apply')
17:46:42.002 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute
error!TypeError: undefined is not an object (evaluating 'e[0].apply')
17:46:42.022 getTemplateInfo== template md5 null ,httpHeader:{}
17:46:42.043 [JS Framework] Failed to execute the callback function:
17:46:42.063 TypeError: undefined is not an object (evaluating 'e[0].apply')
17:46:42.083 [JS Framework] Failed to execute the callback function:
17:46:42.103 TypeError: undefined is not an object (evaluating 'e[0].apply')

2019-10-10 17:50 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

异常原因:undefined is not an object (evaluating 'e[0].apply')
如何定位:你ctrl+f全局找一下哪边调用了这个apply方法就知道哪报错了,
我的回答是:这个错误来自于 e数组的内容为空或e不是数组,导致获取不到下标为0的对象就没有apply方法

  • 小明子 (作者)

    问题是找到了,但是主要是很难定位错误的位置

    2019-10-14 17:28

  • 小明子 (作者)

    全局搜索了找不到的,这个错误是底层的报错,js空指针

    2019-10-14 17:29

1***@163.com

1***@163.com

作者解决了么?我这个报错会导致白屏

  • 小明子 (作者)

    解决了,同一个问题吗?

    2019-12-07 17:28

  • 1***@163.com

    回复 小明子: 16:14:48.078 [JS Framework] Failed to execute the callback function:

    16:14:48.099 TypeError: undefined is not an object (evaluating 'e[0].apply')

    在手机上运行报错如下,请问作者是如何解决的。我这边npm update更新cli版本也会无法更新

    2019-12-09 16:16

4***@qq.com

4***@qq.com

定位不了,而且报错的提醒很不准确,希望作者没有旧版本的hbuilder控制台好用

mandarava

mandarava

用setInterval或者setTimeout函数的时候格式错误,也会有这个错误。
我用的是,

setTimeout(func(),2000)

这样是错的,正确的用法是,

setTimeout(function(){  
    return func()  
},30000)

要用闭包,不然就会有空指针的问题。

  • 小明子 (作者)

    不会吧,我们没出现过,而且大多数用ES6的写法:setTimeout(()=>{ ..... },2000)

    2019-12-25 10:25

w***@163.com

w***@163.com

作者你的问题解决了吗 我的报 TypeError: undefined is not an object (evaluating 'i.$vm.__call_hook')
然后就白屏了

  • 小明子 (作者)

    你这个显然的框架层的问题,更新一下版本吧。应该是UNI跨平台框架里面,获取钩子函数的时候报错

    2020-06-15 14:35

  • woshicainiao

    我报的问题跟你一样,你解决了吗

    2021-05-13 09:07

  • z***@gmail.com

    大兄弟 我现在也报了 跟你同样的错误! 还记得 当时怎么解决的吗

    2023-01-07 11:32

1***@163.com

1***@163.com

请问大佬找到解决方法了吗?我也遇到了同样的问题

  • 小明子 (作者)

    解决了,但是不是很好定位问题,错误日志很模糊

    2020-06-15 14:34

该问题目前已经被锁定, 无法添加新回复