当我尝试使用ES11空合并运算符时,类型记录抛出错误的原因是什么?
Exapmle:
const a = undefined;
const b = a ?? 'test';
导致:
dev_project-shared_server | Using ts-node version 8.10.2, typescript version 3.9.5
dev_project-shared_server | /usr/src/app/services/server/src/index.ts:21
dev_project-shared_server | const b = a ?
我得到了这个错误:
(node:9868) UnhandledPromiseRejectionWarning: #<Object>
(node:9868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch()