Thank you very much! :)
Where exactly are you getting this error?
If it is in connection.start(), did you initialize the "connection" with "HubConnectionBuilder" and then finalized it with ".build()"?
const connection = new HubConnectionBuilder()
.withUrl('https://localhost:5001/hubs/chat')
.withAutomaticReconnect()
.build();
This way you create a connection with access to call "start()"