简体   繁体   English

Firefox 在一些 HTTP 请求后停止接收响应(React + Axios、Node.js 后端),仅发送选项

[英]Firefox stops receiving responses after some HTTP requests (React + Axios, Node.js backend), sends only OPTIONS

As the title says, this only happens in Firefox. After some time the browser only sends OPTIONS requests with no responses, no status, no headers, nothing I can see in the debug console.正如标题所说,这只发生在 Firefox 中。一段时间后,浏览器只发送 OPTIONS 请求,没有响应,没有状态,没有标题,我在调试控制台中什么也看不到。

在此处输入图像描述

All of this works perfectly under Chrome, Safari and Edge.所有这些在 Chrome、Safari 和 Edge 下都能完美运行。 I've already set up CORS middleware and headers within NodeJS, so that's likely not the issue.我已经在 NodeJS 中设置了 CORS 中间件和标头,所以这可能不是问题所在。 I'm completely lost right now.我现在完全迷路了。

在此处输入图像描述

After a lot of banging my head against a wall, I realised that an SQL query from the backend ORM wasn't finding one of the pieces of data I need on the frontend (it was null in the database), so Firefox instead of simply showing me that it's failing decided to just not show anything.经过多次撞墙之后,我意识到来自后端 ORM 的 SQL 查询没有在前端找到我需要的数据之一(数据库中是null ),所以 Firefox 而不是简单的告诉我它失败了决定不显示任何东西。

In short: if you have this problem just check for errors in your backend简而言之:如果您遇到此问题,只需检查后端是否有错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM