Error func.apply不是React native中的函数错误

问题描述 投票:0回答:1

我正在尝试首次创建一个本机应用程序,但出现了我无法理解的奇怪错误。这是我的代码:

update_signals = () => {
    url = this.state.url + "action=get_signals"
    fetch(url).then((response) => {
    /** handling the response */
        object = response.text()
        if (typeof object === "undefined"){}else{
            setTimeout(object.
            then((text) => {
            /** handling the text */
            this.get_signals_form_response(text)
            })
            .catch((error) => {
            /** some problem with getting text from response */
            alert("some error : " + error.message)
            })
            ,10000)
        }
    })
    /** this catch is for total reject */
    .catch((error) => {
        alert("total error : " + error.message)
    })
}

我单击按钮以查看此工作,并且在单击按钮几次后且在前几次工作正常之后,出现此错误。

func.apply is not a function. In "func.apply(undefined,args)" func.apply is undefined

您可以在这里看到图像:

Error Image

即使将其放在try和catch块之间,它也不会将其作为错误来处理。

javascript promise es6-promise
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.