首页 > 解决方案 > express and fetch: TypeError: NetworkError 尝试获取资源时

问题描述

我正在使用 express、fetch 和 firefox。这是代码

async updateTutorial() {
const requestOptions = {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(this.currentTutorial)
    };

  await fetch("https://localhost:9000/tutorial/update" , requestOptions);


}

在 Firefox 中,我看到此错误:TypeError: NetworkError when trying to fetch resource 我不知道这是什么类型的问题。

标签: javascriptexpressfetch

解决方案


我用 div 替换了表单标签。现在没有错误。我忘了提到我得到了这个日志标记:

[HMR] Waiting for update signal from WDS...

推荐阅读