亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

TypeError: E:\movie-master\app\views\pages\detail.jade:13

TypeError: E:\movie-master\app\views\pages\detail.jade:13
? ?11| ? ? ? ? ? .panel-body
? ?12| ? ? ? ? ? ? ul.media-list
?> 13| ? ? ? ? ? ? ? each item in comments
? ?14| ? ? ? ? ? ? ? ?li.media
? ?15| ? ? ? ? ? ? ? ? ?.pull-left
? ?16| ? ? ? ? ? ? ? ? ? ?a.comment(href="#comments", data-cid="#{item._id}", data-tid="#{item.from._id}")

Cannot read property 'length' of undefined
? ?at eval (eval at <anonymous> (E:\movie-master\node_modules\jade\lib\index.js:218:8), <anonymous>:467:31)
? ?at eval (eval at <anonymous> (E:\movie-master\node_modules\jade\lib\index.js:218:8), <anonymous>:876:4)
? ?at eval (eval at <anonymous> (E:\movie-master\node_modules\jade\lib\index.js:218:8), <anonymous>:1066:22)
? ?at res (E:\movie-master\node_modules\jade\lib\index.js:219:38)
? ?at Object.exports.renderFile (E:\movie-master\node_modules\jade\lib\index.js:380:38)
? ?at Object.exports.renderFile (E:\movie-master\node_modules\jade\lib\index.js:370:21)
? ?at View.exports.__express [as engine] (E:\movie-master\node_modules\jade\lib\index.js:417:11)
? ?at View.render (E:\movie-master\node_modules\express\lib\view.js:128:8)
? ?at tryRender (E:\movie-master\node_modules\express\lib\application.js:640:10)
? ?at EventEmitter.render (E:\movie-master\node_modules\express\lib\application.js:592:3)
? ?at ServerResponse.render (E:\movie-master\node_modules\express\lib\response.js:971:7)
? ?at E:\movie-master\app\controllers\movie.js:13:20
? ?at E:\movie-master\node_modules\mongoose\lib\query.js:2843:9
? ?at process._tickCallback (internal/process/next_tick.js:109:7)


這是為什么??

正在回答

4 回答

你好,你的錯誤其實是populate這個方法調用有問題,源頭應該是在comment.js這個定義的問題所在,應該是from的來由有問題,如果你現在是User,你換成user,試試

0 回復 有任何疑惑可以回復我~

me too

0 回復 有任何疑惑可以回復我~

問題解決了嗎,我也出現了同樣的問題,我發現是.populate('from', 'name')這個方法調用有錯誤,我把它刪了就能正常運行,可是不知道要怎么修改

0 回復 有任何疑惑可以回復我~

問題出在commnets,看js文件中commnets是否正確調用,或者拼寫錯誤

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
node建站攻略(二期)——網站升級
  • 參與學習       51926    人
  • 解答問題       423    個

幫助你深入前后端開發留下的迷惑,為進一步自學打下基礎

進入課程

TypeError: E:\movie-master\app\views\pages\detail.jade:13

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號