Javascript 节点捕获()错误不存在';无法显示发生错误的文件
我正在使用节点中的Javascript 节点捕获()错误不存在';无法显示发生错误的文件,javascript,node.js,error-handling,node-inspector,node-debugger,Javascript,Node.js,Error Handling,Node Inspector,Node Debugger,我正在使用节点中的new--inspect参数,用Chrome开发工具调试我的应用程序。我在承诺链的末尾有一个非常基本的catch,但是返回的错误没有清楚地显示它们来自何处 我能看到错误源于哪个文件吗 leagues(app).getLeagues(passData) .then(teamsApi.getNorsemenTeams) .then(filterBarGamesIndex) .then(gamesApi.getNorseGames) .then
new
--inspect
参数,用Chrome开发工具调试我的应用程序。我在承诺链的末尾有一个非常基本的catch
,但是返回的错误没有清楚地显示它们来自何处
我能看到错误源于哪个文件吗
leagues(app).getLeagues(passData)
.then(teamsApi.getNorsemenTeams)
.then(filterBarGamesIndex)
.then(gamesApi.getNorseGames)
.then(gamesApi.getFilteredTeams)
.then(function (passData) {
res.render('games', {
title: 'Results',
passData: passData,
type: req.originalUrl.split('/')[2]
})
})
.catch(function(err) {
console.error(err); //Line 35
});
}
直接从控制台中,错误是:
TypeError: Cannot read property 'Intermediate_Division_2' of undefined
at /var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:27:62
at Array.filter (native)
at module.exports (/var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:25:42)
at process._tickCallback (internal/process/next_tick.js:103:7)
您可能希望转储有关异常的更多信息,如中所示
console.log(err.stack) 这导致了非常类似的错误,遗憾的是TypeError:无法读取/var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:27:62 at Array.filter(native)at module.exports(/var/www/beta.norsemanfc.co.uk/app/controllers/filterBar/fixturesIndex.js:25:42)在进程中。_tickCallback(内部/process/next_tick.js:103:7)
AsfilterBar/fixjs根本不是一个真正的文件。我相信这可能与我使用jade
作为模板有关?这不是“非常相似”。这里有更多的位置。不,它实际上是相同的,我的错误是只在devtools中显示错误。请查看基于错误的更新问题,您的错误似乎发生在filterBarGamesIndex
中,我同意,但我的系统中不存在此类文件:/n您使用的浏览器是什么?如果您使用的是Firefox,您可以尝试console.log(err.lineNumber)
。@Brennananen这是Node.js@PatrickRoberts您是对的,奇怪的是我在搜索fixturesIndex
,我在phpstorm
中使缓存无效,然后它找到了文件。