【发布时间】:2022-12-28 14:56:24
【问题描述】:
node:events:491
throw er; // Unhandled 'error' event
^
TypeError: Cannot set property closed of #<Readable> which has only a getter
at FsReadStream.close (/app/node_modules/memfs/lib/volume.js:2047:17)
at FsReadStream._destroy (/app/node_modules/memfs/lib/volume.js:2032:10)
at _destroy (node:internal/streams/destroy:109:10)
at class_1.destroy (node:internal/streams/destroy:71:5)
at class_1.<anonymous> (/app/node_modules/memfs/lib/volume.js:1962:22)
at class_1.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on class_1 instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v18.9.0
我仔细检查了整个项目中使用 promises 的 try catch 块。 添加了错误边界来解决这个问题,但我的服务器仍然因为这个错误而崩溃。
【问题讨论】:
标签: javascript node.js reactjs react-error-boundary