How to fix Cannot use 'new' with an expression whose type lacks a construct signature in TypeScript | DevErrors