我的目标是如果用户通过身份验证并且输入的长度小于 30,则从用户那里获取输入并将其存储到基础中,然后清除输入并关闭表单。它在后端存储数据,但也会抛出此错误。
这是 firebase 日志中的错误
Unhandled error RangeError: Maximum call stack size exceeded
at Object (native)
at /srv/node_modules/lodash/lodash.js:4919:24
at baseForOwn (/srv/node_modules/lodash/lodash.js:2990:24)
at Function.mapValues (/srv/node_modules/lodash/lodash.js:13426:7)
at encode (/srv/node_modules/firebase-functions/lib/providers/https.js:184:18)
at /srv/node_modules/lodash/lodash.js:13427:38
at /srv/node_modules/lodash/lodash.js:4925:15
at baseForOwn (/srv/node_modules/lodash/lodash.js:2990:24)
at Function.mapValues (/srv/node_modules/lodash/lodash.js:13426:7)
at encode (/srv/node_modules/firebase-functions/lib/providers/https.js:184:18)
完成状态码 500
这是它在浏览器中显示的错误
Error: INTERNAL
at new g (error.ts:66)
at b (error.ts:175)
at A.<anonymous> (service.ts:263)
at tslib.es6.js:100
at Object.next (tslib.es6.js:81)
at r (tslib.es6.js:71)
这是 html 的代码:
<!-- new request modal -->
<div class="new-request">
<div class="modal">
<h2>Request a Tutorial</h2>
<form method="GET" action="#">
<input type="text" name="request" placeholder="Request...">
<button type="submit">Submit Request</button>
<p class="error"></p>
</form>
</div>
</div>
这是给 JS 事件监听器的
// Add a new request
requestForm.addEventListener("submit",(e) => {
e.preventDefault();
const addRequest = firebase.functions().httpsCallable("addRequest");
addRequest({
text : requestForm['request'].value
}).then(() => {
requestForm.reset();
requestModal.classList.remove("open");
requestForm.querySelector(".error").textContent = "";
}).catch((err) => {
console.log(err);
requestForm.querySelector(".error").textContent = err.message;
})
});
潇湘沐
相关分类