Skip to content

WebSocket not imported in dist/main/src/utils/ButtplugBrowserWebsocketConnector.js, leading to "WebSocket is not defined" error #275

@Oman395

Description

@Oman395

I think the title explains it pretty well. Attempts to instantiate a ButtplugBrowserWebsocketClientConnector fail, because WebSocket is not imported from ws (despite ws being a dependency).

The workaround I've found is to import websocket in my main script, then define it globally:

import { WebSocket } from 'ws';
Object.assign(global, { WebSocket: WebSocket });

Which works, but isn't ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions