Skip to content

Use global WebSocket constructor if available #9645

@williamhorning

Description

@williamhorning

Which application or package is this feature request for?

ws

Feature

Currently, Discord.js uses the ws module from npm, which works just fine in Node. However, this module causes issues on alternative JS runtimes like Deno.

Ideal solution or implementation

Discord.js should check to see if the WebSocket constructor is available globally and use that instead of the ws module if it's available.

Alternative solutions or implementations

Other context

The error thrown under Deno: terminal screenshot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions