Nodejs报内部错误 TypeError: Cannot read property ‘destroy‘ of undefined的解决方法

Posted 秋9

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nodejs报内部错误 TypeError: Cannot read property ‘destroy‘ of undefined的解决方法相关的知识,希望对你有一定的参考价值。

Nodejs报内部错误 TypeError: Cannot read property 'destroy' of undefined的解决方法

【现象】

内部错误 TypeError: Cannot read property 'destroy' of undefined
    at AutoSceneService.getGroup (D:\\work\\intellij\\exampledemo\\app\\service\\autoScene.js:26:40)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async GroupController.groupList (D:\\work\\intellij\\exampledemo\\app\\controller\\group.js:17:17)
    at async D:\\work\\intellij\\exampledemo\\app\\middleware\\jwtsk.js:20:16
    at async D:\\work\\intellij\\exampledemo\\node_modules\\egg-development\\app\\middleware\\egg_loader_trace.js:9:50
    at async xframe (D:\\work\\intellij\\exampledemo\\node_modules\\egg-security\\lib\\middlewares\\xframe.js:7:5)
    at async xssProtection (D:\\work\\intellij\\exampledemo\\node_modules\\egg-security\\lib\\middlewares\\xssProtection.js:7:5)
    at async nosniff (D:\\work\\intellij\\exampledemo\\node_modules\\egg-security\\lib\\middlewares\\nosniff.js:8:5)
    at async noopen (D:\\work\\intellij\\exampledemo\\node_modules\\egg-security\\lib\\middlewares\\noopen.js:8:5)

 

【解决方法】

新增

const _ = require('lodash')    

例如

以上是关于Nodejs报内部错误 TypeError: Cannot read property ‘destroy‘ of undefined的解决方法的主要内容,如果未能解决你的问题,请参考以下文章

node.js读取目录报错“TypeError: Cannot read properties of undefined (reading ‘isDirectory‘)“

TypeError [ERR_INVALID_ARG_TYPE] 尝试将错误写入 Nodejs 中的文件时

NodeJs,mongoDB:TypeError:无法读取未定义的属性“全名”

NodeJs : TypeError: require(...) is not a function

TypeError:无法在nodejs中读取未定义的属性“email”

Nodejs Promise TypeError:无法读取未定义的属性'then'