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

process.send is not a function using discord.js v14.12.1 #4159

Closed
MrSerge01 opened this issue Aug 15, 2023 · 2 comments
Closed

process.send is not a function using discord.js v14.12.1 #4159

MrSerge01 opened this issue Aug 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@MrSerge01
Copy link

What version of Bun is running?

0.7.3

What platform is your computer?

Microsoft Windows NT 10.0.22621.0 x64

What steps can reproduce the bug?

Run tsc -b ./ && bun ./dist/index.js
(building and running from dist because ShardingManager requires a .js file, else it errors)

index.ts:

import { ShardingManager } from "discord.js";

const manager = new ShardingManager("./dist/bot.js", { token: Bun.env.DISCORD_TOKEN });

manager.on("shardCreate", shard => {
  shard.on("error", err => console.error(err));
  console.log(`Launched shard ${shard.id}`);
});

manager.spawn();

error:

32 | 
33 |     switch (mode) {
34 |       case 'process':
35 |         process.on('message', this._handleMessage.bind(this));
36 |         client.on(Events.ShardReady, () => {
37 |           process.send({ _ready: true });
              ^
TypeError: process.send is not a function. (In 'process.send({ _ready: !0 })', 'process.send' is undefined)
      at /mnt/c/users/user/documents/gitlab/discord-module/node_modules/discord.js/src/sharding/ShardClientUtil.js:37:10
      at emit (node:events:1:4874)
      at /mnt/c/users/user/documents/gitlab/discord-module/node_modules/discord.js/src/client/websocket/WebSocketManager.js:199:10
      at emit (node:events:1:4324)
      at checkReady (/mnt/c/users/user/documents/gitlab/discord-module/node_modules/discord.js/src/client/websocket/WebSocketShard.js:181:6)
      at gotGuild (/mnt/c/users/user/documents/gitlab/discord-module/node_modules/discord.js/src/client/websocket/WebSocketShard.js:155:4)
      at /mnt/c/users/user/documents/gitlab/discord-module/node_modules/discord.js/src/client/websocket/WebSocketManager.js:241:8
      at emit (/mnt/c/users/user/documents/gitlab/discord-module/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:21)
      at emit (/mnt/c/users/user/documents/gitlab/discord-module/node_modules/@vladfrangu/async_event_emitter/dist/index.js:282:21)
      at /mnt/c/users/user/documents/gitlab/discord-module/node_modules/@discordjs/ws/dist/index.js:988:8

What is the expected behavior?

The bot starts and functions normally.

What do you see instead?

No response

Additional information

No response

@MrSerge01 MrSerge01 added the bug Something isn't working label Aug 15, 2023
@Jarred-Sumner
Copy link
Collaborator

We haven’t implemented IPC yet

@paperdave
Copy link
Collaborator

Closed in #4468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants