1
以下內容會導致一個相當神祕的TypeScript構建錯誤:Exported variable 'res' has or is using private type 'Result'
。導出的變量已經或正在使用私人類型TypeScript錯誤
interface Result {
status: string;
comment: string;
}
function runTest(st: any) {
try {
} catch (err) {
console.log('Failed test task: ' + err);
console.log('Failed test task: ' + st.name);
console.log(err.stack);
var res: Result = {
status: 'bad',
comment: 'Nodejs exception: ' + err,
};
//saveTestResult(st, res);
}
};
export function what() {};
這一切ok如果任:
- 刪除的try/catch
- 不導出功能
what
這是怎麼回事?
整潔。謝謝!有沒有公開的問題,還是應該提交? – ubershmekel