Error with typescript + socket.io

Have you tried using webpack?
Try my template Phaser 3 - Starter Templates with ES6+ (ESNext) or TypeScript