title: SignalR Javascript Client - Invoke method work but promise didn't work (???)
body: <p>Currently I'm studying SignalR for ASP.NET Core web project, I use ASP.NET Core as a server for SignalR and web clients use SignalR Javascript Client.
  I'm making a chat app that will return some message when the client invoke function from the server.
  Here's my Javascript client function:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>      this.hub.invoke(method, data)
        .then((res)=&gt;{ alert(res);})
        .catch(err=&gt; alert(err));</code></pre>
  </div>
  </div>
  
  The server method:</p>
  
  <pre><code>    public async Task&lt;IActionResult&gt; joinRoom(string roomId)
      {
          Console.WriteLine(roomId);
          return new OkObjectResult("Ok");
      }
  </code></pre>
  
  <p>Problem:</p>
  
  <ul>
  <li><p>Invocation success, Console on the server side wrote the roomId</p></li>
  <li><p>However, the client side's <strong>Promise.then/Promise.catch didn't work</strong>.</p></li>
  </ul>
  
  <p>When I close the server, there're multiple error on client side that said <strong><em>Invocation has been canceled due to the connection was closed.</em></strong></p>
  
  <p>My SignalR version is 1.0.3</p>
  
  <p>Really, I can't find out what's the reason. I hope you can help me, please... I also tried with return a string on the server side but it didn't work too.</p>