Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Oman395 opened this issue Apr 20, 2024 · 0 comments
Labels

Comments

@Oman395
Copy link

Oman395 commented Apr 20, 2024

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.

@Oman395 Oman395 added the bug label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant