Share via

how to use signalr in wechat miniprogram?

mc 6,801 Reputation points
2023-06-10T13:47:29.28+00:00

there will be error:

module 'utils/microsoft-signalr/ws.js' is not defined, require args is 'ws'

here is my code:

var signalr =require('./utils/microsoft-signalr/signalr')
var connection=new signalr.HubConnectionBuilder().withUrl('https://read.huafajiaoyu.com/api/ws-socket-hub').build();
Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

Answer accepted by question author
  1. Bruce (SqlWork.com) 83,661 Reputation points Volunteer Moderator
    2023-06-10T15:57:58.1033333+00:00

    The error states that the file ./utils/microsoft-signalr/signalr.js is looking for an additional files. How did you install the client, and are you using the correct one. There is a signalr client for 4.* and one core core. They are not compatible.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.