我正在尝试首次创建一个本机应用程序,但出现了我无法理解的奇怪错误。这是我的代码:
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
您可以在此处查看图像:
即使我将其放在try和catch块之间,它也不会将其视为错误。