報錯The "chunk" argument must be one of type string or Buffer. Received type object


報錯內容:

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object
at ServerResponse.end (_http_outgoing.js:690:13)

原因:

response.end()方法接收的參數類型只能是字符串或Buffer,

傳入的是object

解決:

 

 找到代碼出錯行,重寫end方法,如:response.end('一些內容')

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM