3
Looks like the module that you are using is for the server-side and not the client-side socket.io lib you need. Use the client site script instead.
You can just use the <script> tag in your HTML index.html and import the socket.io js file for the client site
<script src="/socket.io/socket.io.js"></script>
<script>
const ...
answered Jan 13 at 17:02
Mohith Shrivastava
78.5k1616 gold badges126126 silver badges174174 bronze badges
1
Your WS path looks good to me it may an issue on the server side.
Here's how I build the WS URL on the client side to run on local and Heroku:
const wsUrl = (window.location.protocol === 'http:' ? 'ws://' : 'wss://') + window.location.host;
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
websockets × 4lightning-aura-components × 1
lightning × 1
lightning-web-components × 1
heroku × 1
create-lwc-app × 1
livechattranscript × 1
softphone × 1
lwc-oss × 1
amazon-aws × 1