Skip to content

TypeError: Cannot read properties of undefined (reading 'digest') only when loading the file through OBS #8

@nicholasudell

Description

@nicholasudell

Using the following code to connect to my streamerbot client:

test.js:

const client = new StreamerbotClient({
    port: port,
    password: password,
    onError: (e) => {
        log('Streamerbot error, make sure the server is running.');
        log(e);
    },
    onConnect: (data) => {
        log("Streamerbot connected.");
    },
    onDisconnect: (data) => {
        log("Streamerbot disconnected.");
    }
});

in a web page consisting of:

<html>
    <head>
        <link rel="stylesheet" href="./Score.css"></link>
    </head>
    <body>
        
        <div id="errors"></div>
        <script type="text/javascript" src="https://unpkg.com/@streamerbot/client/dist/streamerbot-client.js"></script>
        <script type="text/javascript" src="./test.js"></script>
    </body>
</html>

Saved on my local machine and added via Browser Source in OBS using the "Local File" switch, gives me this sequence coming through the logs:

Connecting to streamer bot
Streamerbot error, make sure the server is running.
TypeError: TypeError: Cannot read properties of undefined (reading 'digest')
Streamerbot Disconnected

If I open this web page in a browser (using Firefox latest), everything connects fine, and I instead get:

Connecting to streamer bot
Streamerbot connected.

I would expect this to work the same when opened in a browser as when run as a local file in OBS.

I have previously written widgets that are run as local files in OBS that use javascript web sockets to connect to streamer bot without using the client, and those have connected successfully. I had hoped to use the streamerbot client to streamline this, but at the moment, this does not work.

Metadata

Metadata

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions