Skip to content

Custom widget (Advanced) doesn't recognize utils.stylesToString() #3479

@Alastor-git

Description

@Alastor-git

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When trying to run the sample custom-advanced widget, which uses utils.stylesToString(), the script doesn't display a red square on the page as it's supposed to.
The javascript console of the overlay indicates :

overlay/:1411 TypeError: utils.stylesToString is not a function
    at eval (eval at runRawJs (overlay/:1178:38), <anonymous>:16:43)
    at runRawJs (overlay/:1407:27)
    at EventEmitter.<anonymous> (overlay/:1414:19)
    at EventEmitter.emit (util.js:236:26)
    at handleOverlayEvent (overlay-widgets.ts:232:18)
    at ws.onmessage (main.js:112:17)
    at HTMLDivElement.<anonymous> (reconnecting-websocket.js:182:75)
    at ws.onmessage (reconnecting-websocket.js:282:29)```

### Expected Behavior

No javascript error should be raised and the overlay should display a red square 100x100px, 100px away from the top-left corner of the page. 

### Steps To Reproduce

1. Create the default `Custom (Advanced)` widget
2. Get the address of the targeted overlay
3. Open the overlay in a web browser

Upon further examination, it appears that in `...\overlay-widgets\builtin-types\custom\custom-advanced.ts`, line 116, the `utils` object that is declared to the overlay code has the `sendMessageToFirebot()` bound to it but not the `stylesToString()` one. Thus causing the issue. 

### Version

5.65.4

### What operating system are you using Firebot on?

Windows 11

### Relevant log output

```shell

Contact Details (Optional)

alastor

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release PendingIssue has been resolved and is waiting to be packaged as part of a release

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions