typeerror - 未捕获的类型错误:无法读取 null 的属性(读取“长度”)
问题描述
我的代码不断吐出这个错误,它在 VS 代码中有效,但在托管服务器中无效。如果我能得到另一双眼睛,那就太好了。
(index.js file)
if (Firstchild.tasks.length !== null) {
Firstchild.load();
Firstchild.render();
}
(taskmanager.js file)
render() {
clearBox();
const tasksHtmlList = [];
for (let i = 0; i < this.tasks.length; i++) {
const firstVariable = this.tasks[i];
const date = new Date(firstVariable.dueDate);
date.setDate(date.getDate() + 1);
const formattedDate = date.toDateString();
const taskHtml = createTaskHtml(firstVariable.id, firstVariable.taskTitle, firstVariable.description, firstVariable.assignedTo, formattedDate, firstVariable.taskStatus)
tasksHtmlList.push(taskHtml);
}
解决方案
推荐阅读
- email - 禁用电子邮件转发上的链接
- docker - 在 Kubernetes 内运行的 Docker Private Registry 的多用户身份验证
- android - 切换片段时跳转滚动
- java - java小程序(绘制快乐或笑脸)
- python - 使用 os.rename() 后重命名的文件被删除/移动到未知位置
- feathersjs - 如何识别上下文是来自身份验证钩子(某些钩子)还是其他钩子?
- java - poi和poi-ooxml有什么区别
- c - 如何使用和构建生成文件以将 scip 链接到 C?
- microsoft-graph-api - O365 - E5 开发人员计划 - Microsoft Graph 查询服务不可用
- c# - 创建一个返回正则表达式匹配命令的类的最佳方法