TypeError: this.router.ws is not a function
import expressWs from 'express-ws';
expressWs(app);
Adding this to my main file fixed the issue w/ the TyperError (below). Maybe there's a better way to do it, not sure. This could be added to the example esm/Example/main.js
at some point. (I thought it's not worth to make a fork/pull req. because of this.)
Thx :3
ref: https://github.com/HenningM/express-ws
/node_modules/@lsys/projectData$ npm run start
> @lsys/projectData@2.4.2 start /home/cem/website_reflect/example-test/node_modules/@lsys/projectData
> node --experimental-modules --es-module-specifier-resolution=node ./esm/Example/main.js
(node:15444) ExperimentalWarning: The ESM module loader is experimental.
(node:15444) UnhandledPromiseRejectionWarning: TypeError: this.router.ws is not a function
at Endpoint.init (file:///home/cem/website_reflect/example-test/node_modules/@lsys/projectData/esm/Endpoint.js:51:21)
at new Endpoint (file:///home/cem/website_reflect/example-test/node_modules/@lsys/projectData/esm/Endpoint.js:36:27)
at file:///home/cem/website_reflect/example-test/node_modules/@lsys/projectData/esm/Example/main.js:22:28
at ModuleJob.run (internal/modules/esm/module_job.js:110:37)
at async Loader.import (internal/modules/esm/loader.js:167:24)
(node:15444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.