Connection.invoke
immediately returns a JavaScript promise, so I think you need to chain then()
calls for anything that requires the connection to be started and available.
While the code looks like it's invoking JoinGroup after the Connection has started, what actually happens is the Connection start method is called, a promise is returned while waiting for the connection to be established between client and server, and immediately after that the invoke method is called before the connection is fully started.
Connection.start().then( result => {
console.log("SignalR is now connected")
}).then( result => {
Connection.invoke("JoinGroup", "PrivateGroup")
});