请问这个服务器 500 是什么情况 ?
[nodemon] starting node --inspect=9229 bin/www
Debugger listening on ws://127.0.0.1:9229/73592b1c-175a-43e8-9012-79fb204a99ce
For help, see: https://nodejs.org/en/docs/inspector
<-- GET /
xxx GET / 500 17ms -
server error ReferenceError: /Users/ann/Documents/Nodejs/wbproject/kwc/src/views/index.ejs:11
9|
10| <!-- 微博列表 -->
11| <% if (blogData.isEmpty) { %>
12| <div>
13| <center>暂无数据</center>
14| </div>
blogData is not defined
at eval (eval at compile (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/ejs/lib/ejs.js:464:12), <anonymous>:15:8)
at returnedFn (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/ejs/lib/ejs.js:493:17)
at /Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:645:16
at /Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:161:5
at Promise._execute (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/bluebird/js/release/debuggability.js:384:9)
at Promise._resolveFromExecutor (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/bluebird/js/release/promise.js:518:18)
at new Promise (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/bluebird/js/release/promise.js:103:10)
at promisify (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:154:10)
at exports.ejs.render (/Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:641:10)
at /Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:181:27
at /Users/ann/Documents/Nodejs/wbproject/kwc/node_modules/consolidate/lib/consolidate.js:101:5
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
path: '/Users/ann/Documents/Nodejs/wbproject/kwc/src/views/index.ejs'
} {
request: {
method: 'GET',
url: '/',
header: {
host: 'localhost:3000',
connection: 'keep-alive',
'cache-control': 'max-age=0',
'sec-ch-ua': '"Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"',
'sec-ch-ua-mobile': '?0',
已经审核,并比对了代码;该定义的变量和引用都有;
routers/blog 也已经提供了 view 路由。
添加blogData是undefine的定义