To Reproduce
Do check out & run example.ts to see an example usage of the library. The script covers most common use cases. To run the example script, download or clone the repo and then type the following in a terminal:
cd path/to/Baileys
yarn
yarn example
It gives error:
allburov@allburov:~/git/WhiskeySockets-Baileys$ yarn example
yarn run v1.22.19
$ node --inspect -r ts-node/register Example/example.ts
Debugger listening on ws://127.0.0.1:9229/d16971b4-734a-46cb-8f7d-627054174eeb
For help, see: https://nodejs.org/en/docs/inspector
using WA v2.2325.3, isLatest: true
/home/allburov/git/WhiskeySockets-Baileys/src/Utils/auth-utils.js:53
var cache = _cache || new node_cache_1["default"]({
^
TypeError: node_cache_1.default is not a constructor
at makeCacheableSignalKeyStore (/home/allburov/git/WhiskeySockets-Baileys/src/Utils/auth-utils.js:53:27)
at startSock (/home/allburov/git/WhiskeySockets-Baileys/Example/example.ts:43:37)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior
Everything works
Environment (please complete the following information):
Is this on a server? no
What do your connectOptions look like? What we have in example.ts
Do you have multiple clients on the same IP? no
Are you using a proxy? no
Additional context
Node v18.12.0
If I remove makeCacheableSignalKeyStoreusage it gives another (but similar) error:
allburov@allburov-ubuntu:~/git/WhiskeySockets-Baileys$ yarn example
yarn run v1.22.19
$ node --inspect -r ts-node/register Example/example.ts
Debugger listening on ws://127.0.0.1:9229/54cbe47e-7e65-47d2-8ad1-f49dd9149db2
For help, see: https://nodejs.org/en/docs/inspector
using WA v2.2325.3, isLatest: true
/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:115
this.socket = new ws_1["default"](this.url, {
^
TypeError: ws_1.default is not a constructor
at WebSocketClient.<anonymous> (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:115:31)
at step (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:48:23)
at Object.next (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:29:53)
at /home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:23:71
at new Promise (<anonymous>)
at __awaiter (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:19:12)
at WebSocketClient.connect (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/Client/web-socket-client.js:108:16)
at makeSocket (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/socket.js:66:8)
at makeChatsSocket (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/chats.js:63:40)
at makeGroupsSocket (/home/allburov/git/WhiskeySockets-Baileys/src/Socket/groups.js:57:44)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Probably some command has been missed in the README.md for the example.ts
Describe the bug If you follow the guide for "example.ts" file - it doesn't work https://github.com/WhiskeySockets/Baileys#example
To Reproduce Do check out & run example.ts to see an example usage of the library. The script covers most common use cases. To run the example script, download or clone the repo and then type the following in a terminal:
It gives error:
Expected behavior Everything works
Environment (please complete the following information):
connectOptions
look like? What we have in example.tsAdditional context
makeCacheableSignalKeyStore
usage it gives another (but similar) error:Probably some command has been missed in the README.md for the example.ts