I have read the above disclaimer and I am submitting a new bug report and have verified no other duplicate reports exist in the Issues or Discussions tabs.
Describe the Issue
As of v2.0.4, on node.js v20.11.1, this library errors out in two places:
- When attempting to connect via websocket (SocketManager:96)
Failed to connect: TypeError: IsomorphousWebSocket is not a constructor
at file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:1184:24
at new Promise (<anonymous>)
at SocketManager.connect (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:1179:14)
at SocketManager.connect (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:1169:29)
at async Client.login (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:1354:5)
- When trying to perform a debugLogVersions operation (DataStorageManager:44)
ReferenceError: navigator is not defined
at file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:407:63
at ArchipelagoEventEmitter.dispatchEvent (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:483:7)
at SocketManager.emit (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:514:18)
at #parseMessage (file:///C:/dev/proj/archipelago-webhook/node_modules/archipelago.js/dist/index.js:1235:16)
at callListener (C:\dev\proj\archipelago-webhook\node_modules\ws\lib\event-target.js:290:14)
at WebSocket.onMessage (C:\dev\proj\archipelago-webhook\node_modules\ws\lib\event-target.js:209:9)
at WebSocket.emit (node:events:518:28)
at Receiver.receiverOnMessage (C:\dev\proj\archipelago-webhook\node_modules\ws\lib\websocket.js:1220:20)
at Receiver.emit (node:events:518:28)
at Receiver.dataMessage (C:\dev\proj\archipelago-webhook\node_modules\ws\lib\receiver.js:596:14)
As a workaround, I was able to achieve functionality by stuffing the global namespace with values, but this isn't a particularly good solution.
import WebSocket from "ws";
global.WebSocket = WebSocket;
global.navigator = {
userAgent: 'archipelago.js'
};
Reproduction Steps
Use the node-based example as shown in the documentation https://archipelago.js.org/stable/documents/Creating_Your_Client.html#md:node-based-example
Expected Behavior
The library should perform as shown in the documentation
Library Version
2.0.4
Environment / Runtime
Node v20.11.1
Project Repository
No response
Additional Notes, Screenshots, or Files
No response
I have read the above disclaimer and I am submitting a new bug report and have verified no other duplicate reports exist in the Issues or Discussions tabs.
Describe the Issue
As of v2.0.4, on node.js v20.11.1, this library errors out in two places:
As a workaround, I was able to achieve functionality by stuffing the global namespace with values, but this isn't a particularly good solution.
Reproduction Steps
Use the node-based example as shown in the documentation https://archipelago.js.org/stable/documents/Creating_Your_Client.html#md:node-based-example
Expected Behavior
The library should perform as shown in the documentation
Library Version
2.0.4
Environment / Runtime
Node v20.11.1
Project Repository
No response
Additional Notes, Screenshots, or Files
No response