“Uncaught TypeError: Object.setPrototypeOf called on null or undefined” after upgrading Angular project

前端 未结 1 467
清酒与你
清酒与你 2021-01-18 09:38

I have an Angular application, which works perfectly. However, after upgrading the dependencies using yarn upgrade, I\'m getting this cryptic error:

<         


        
相关标签:
1条回答
  • 2021-01-18 10:19

    Without any meaningful error messages and with stack trace telling me almost nothing. I've decided to investigate what was actually triggering this problem. Considering it appeared after dependency upgrade, I've pulled up the diff for yarn.lock and started to revert some parts of it and recompiling the application along the way checking if it will make the error go away. After some tedious work I found out that it was caused by TypeScript being updated from 2.3.4 to 2.4.0.

    So the next step would be to study the changelog and to analyze what could have broken in my code.

    So, in the end I would recommend to upgrade your dependencies more often (this will help to reduce upgrade size in case you will need to investigate it).

    I hope it would help someone. Cheers!

    Update

    • After further investigation I've found out the exact case when this error is happening, so I've posted an issue to Angular GitHub repository.

    • And finally, here's the actual culprit issue in TypeScript.

    0 讨论(0)
提交回复
热议问题