Ionic 5 Websocket Server not working

I’ve run into multiple issues trying to get the documented example for Websocket Server to work. The issue I’m finally stumped on is that this line:

this.wsserver.watchMessage().subscribe(result => {

gives this error

TypeError: window.cordova.plugins.wsserver[fnName] is not a function

I’ve tried uninstalling and reinstalling the npm packages but don’t know what else to do to try and resolve this.

For reference, previous issue was that the documented example line

import { WebSocketServer } from '@ionic-native/web-socket-server';

causes the constructor to fail because WebSocketServer is a value, and instead should be

import { WebSocketServer } from '@ionic-native/web-socket-server/ngx';

This is a really stupid question, but where are you trying to run this? If the answer is “in a desktop browser”, then you need to run cordova-needing things on devices or emulators, instead.

Yeah, running on two different android phones.

Some additional info. In case it wasn’t obvious, the error is coming from the plugin itself, not my app code. Here’s the full trace from Chrome

Uncaught TypeError: window.cordova.plugins.wsserver[fnName] is not a function
    at Observable._subscribe (vendor-es2015.js:121793)
    at Observable._trySubscribe (vendor-es2015.js:136626)
    at Observable.subscribe (vendor-es2015.js:136612)
    at WebrtcService.wait (party-party-module-es2015.js:461)

With the specific error line being

var id = window.cordova.plugins.wsserver[fnName](, observer.error.bind(observer));

Which is line 25 in node_modules/@ionic-native/web-socket-server/index.js

So it feels like something isn’t wired up right. Maybe there’s something I need to import, either in my local class or maybe the app providers, but I’m not sure what it might be.