-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Application Details:
Twitch Application Scopes: chat:read, chat:edit
Intended Functionality: Twitch chat interaction (Word Scramble game, etc.)
EventSub Usage: Not used. Mix It Up handles relevant events.
Issue Description:
I'm experiencing two distinct issues when using ComfyJS, depending on the version:
- Incorrect Scope Requests (ComfyJS 1.1.15):
When using ComfyJS version 1.1.15 (<script src="https://cdn.jsdelivr.net/npm/comfy.js@1.1.15/dist/comfy.min.js"></script>), I consistently receive an "Invalid Password or Permission Scopes" error in the browser console.
The error message indicates that ComfyJS is attempting to access the channel:read:redemptions and user:read:email scopes.
These scopes are not required for my application's functionality, and my Twitch application is only configured for chat:read and chat:edit scopes.
This error occurs even when using a very basic HTML script, proving that it is not related to any complex code, or the Mix It Up application.
Example of console log from basic test script:
comfy.min.js:1 Invalid Password or Permission Scopes (channel:read:redemptions, user:read:email)
e @ comfy.min.js:1
await in e
Init @ comfy.min.js:1
(anonymous) @ VM439 about:srcdoc:4
comfy.min.js:1 Connected:irc-ws.chat.twitch.tv:443
This error prevents ComfyJS from initializing correctly.
- WebSocket Errors (ComfyJS @latest):
When using the latest version of ComfyJS (<script src="https://cdn.jsdelivr.net/npm/comfy.js@latest/dist/comfy.min.js"></script>), I encounter repeated WebSocket connection errors in the browser console.
These errors occur even when ComfyJS.Events = false; is explicitly set before ComfyJS.Init().
The errors indicate failed attempts to connect to wss://eventsub.wss.twitch.tv/ws.
Example of console log:
comfy.min.js:1 WebSocket connection to 'wss://eventsub.wss.twitch.tv/ws' failed:
l @ comfy.min.js:1
comfy.min.js:1 Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
m.onerror @ comfy.min.js:1
error
l @ comfy.min.js:1
await in l
Init @ comfy.min.js:1
(anonymous) @ VM262 about:srcdoc:6
comfy.min.js:1 Connected:irc-ws.chat.twitch.tv:443
This error prevents the script from functioning correctly.
Minimal Reproducible Example (for 1.1.15 scope error):
HTML
<script src="https://cdn.jsdelivr.net/npm/comfy.js@1.1.15/dist/comfy.min.js"></script> <script type="text/javascript"> const accessToken = "YOUR_ACCESS_TOKEN"; // Replace with your actual token ComfyJS.Init("YOUR_CHANNEL_NAME", `oauth:${accessToken}`);
ComfyJS.onChat = (user, message, flags, self, extra) => {
console.log("onChat triggered:", user, message);
};
</script>
Steps to Reproduce (for 1.1.15 scope error):
Create a new HTML file.
Add the provided HTML code to the file.
Replace YOUR_ACCESS_TOKEN and YOUR_CHANNEL_NAME with your actual values.
Open the HTML file in a web browser and open the developer console.
Observe the "Invalid Password or Permission Scopes" error.
Steps to Reproduce (for @latest WebSocket error):
Change the script tag in the above HTML to use @latest.
Observe the websocket errors.
Expected Behavior:
ComfyJS should initialize successfully with only the chat:read and chat:edit scopes.
With ComfyJS.Events = false;, no WebSocket connection attempts should be made.
Actual Behavior:
"Invalid Password or Permission Scopes" error occurs with 1.1.15.
WebSocket errors occur with @latest.
Additional Notes:
The issue occurs consistently across different environments (Mix It Up, standard browsers, VS Code live preview).
The Twitch application has been configured correctly with the specified scopes.
The access token has been validated and confirmed to have the correct scopes.
This is preventing the use of ComfyJS in applications that do not require, or have set, the extra scopes.