obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
680 stars 96 forks source link

OBSWebSocket is not a constructor #267

Closed slashinfty closed 3 years ago

slashinfty commented 3 years ago

Description:

I keep getting Uncaught TypeError: OBSWebSocket is not a constructor.

My code for it is

const { OBSWebSocket } = require('obs-websocket-js');
const obs = new OBSWebSocket();

Versions Used (if applicable):

slashinfty commented 3 years ago

Did not looked at v4 documentation, which requires

const OBSWebSocket = require('obs-websocket-js')
faraamcode commented 2 years ago

This same thing happen to me while trying to use it with nestjs but I solved it

import  *  as OBSWebSocket  from  'obs-websocket-js'

const obs = new OBSWebsocket()