Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Network Connection Fails in discord.js on Deno #26216

Open
speedfighter opened this issue Oct 13, 2024 · 0 comments
Open

Error when Network Connection Fails in discord.js on Deno #26216

speedfighter opened this issue Oct 13, 2024 · 0 comments
Labels
bug Something isn't working correctly node compat

Comments

@speedfighter
Copy link

When the network connection encounters an error, I receive the following error from discord.js

Uncaught TypeError: Cannot use 'in' operator to search for 'code' in undefined
    at WebSocketShard.onError (file:///C:/Users/fabia/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/ws/1.1.1/dist/index.js:1065:16)
    at WebSocket.connection.onerror (file:///C:/Users/fabia/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/ws/1.1.1/dist/index.js:683:12)
    at WebSocket.wrappedHandler (ext:deno_web/02_event.js:1400:12)
    at innerInvokeEventListeners (ext:deno_web/02_event.js:757:7)
    at invokeEventListeners (ext:deno_web/02_event.js:804:5)
    at dispatch (ext:deno_web/02_event.js:661:9)
    at WebSocket.dispatchEvent (ext:deno_web/02_event.js:1041:12)
    at WebSocket.[[[eventLoop]]] (ext:deno_websocket/01_websocket.js:494:16)
    at eventLoopTick (ext:core/01_core.js:175:7)

However, when I test the same code with Node.js, this error does not occur. According to the discord.js github (Github discord.js Issue), the issue seems to be related to Deno.

Version: Deno 2.0.0

@littledivy littledivy added bug Something isn't working correctly node compat labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

2 participants