Node.js/err

来自康健生活
Kangkk​(留言 | 贡献)2020年7月5日 (日) 15:38的版本 (创建页面,内容为“== 引言 == * UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON *: 定位问题 *: <syntaxhighlight lang="javascript"> process.on('…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

引言

  • UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    定位问题
    process.on('unhandledRejection', (reason, p) => {
                console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
                // application specific logging, throwing an error, or other logic here
            });
    
  • property 'socket' -> object with constructor 'Socket'
  • Cannot set headers after they are sent to the client