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

Some nodemon issue #10991

Open
rederek64 opened this issue May 10, 2024 · 0 comments · May be fixed by #11102
Open

Some nodemon issue #10991

rederek64 opened this issue May 10, 2024 · 0 comments · May be fixed by #11102
Labels
bug Something isn't working crash An issue that could cause a crash

Comments

@rederek64
Copy link

How can we reproduce the crash?

No response

JavaScript/TypeScript code that reproduces the crash?

################## ./classes/client ##################
import { Client, Partials, IntentsBitField, ActivityType } from 'discord.js';

export default class DiscordClient extends Client {
    constructor() {
        super (
            {
                partials: [Partials.Channel, Partials.GuildMember, Partials.GuildScheduledEvent, Partials.Message, Partials.Reaction, Partials.ThreadMember, Partials.User],
                intents: [IntentsBitField.Flags.AutoModerationConfiguration, IntentsBitField.Flags.AutoModerationExecution, IntentsBitField.Flags.DirectMessageReactions, IntentsBitField.Flags.DirectMessageTyping, IntentsBitField.Flags.DirectMessages, IntentsBitField.Flags.GuildEmojisAndStickers, IntentsBitField.Flags.GuildEmojisAndStickers, IntentsBitField.Flags.GuildIntegrations, IntentsBitField.Flags.GuildInvites, IntentsBitField.Flags.GuildMembers, IntentsBitField.Flags.GuildMessageReactions, IntentsBitField.Flags.GuildMessageTyping, IntentsBitField.Flags.GuildMessages, IntentsBitField.Flags.GuildModeration, IntentsBitField.Flags.GuildPresences, IntentsBitField.Flags.GuildScheduledEvents, IntentsBitField.Flags.GuildVoiceStates, IntentsBitField.Flags.GuildWebhooks, IntentsBitField.Flags.Guilds, IntentsBitField.Flags.MessageContent],
                presence: {
                    afk: false,
                    status: "dnd",
                    activities: [
                        {
                            type: ActivityType.Watching,
                            name: "QuietMolly Casino"
                        }
                    ]
                }
            }
        )
    }
}
######################################################

###################### bot.ts ########################

//! ↓ Imports ↓

import DiscordClient from './classes/client';
import { runDB, ticket, user, world, items } from './utils/mongo';
import config from './data/config';
import fs from 'fs';
import path from 'path';

//! ↓ Create the bot client ↓
const client = new DiscordClient();

client.login(config.token);

//! ↓ Run the database ↓
runDB(config.mongoUri);
const db = { user, world, ticket, items }

//! ↓ Event Handler ↓

// ? ↓ Loads all the events in the events folder. ↓     

const events: string[] = fs.readdirSync(path.join(__dirname + '/events'));
console.info("Loaded " + events.length + " Events");

//? ↓ Runs all of the events in the events folder. ↓        
events.forEach(async event => {

    const ev = await require("./events/" + event);

    //? ↓ Runs the event depending on the type (once / on) ↓
    if (ev.default.once) client.once(ev.default.name, (...args) => ev.default.run(client, db, ...args))
    else client.on(ev.default.name, (...args) => ev.default.run(client, db, ...args));

});

//! ↓ Application AntiCrash ↓

process.on('unhandledRejection', console.error);
process.on('uncaughtException', console.error);

Relevant log output

[nodemon] starting `bun run ./bot.ts .`
Loaded 4 Events
============================================================
Bun v1.1.6-canary.1 (84d81c30) Windows x64
Args: "bun", "run", "./bot.ts", "."
Features: Bun.stdin(2) fetch transpiler_cache(10) tsconfig(6) WebSocket 
Builtins: "bun:main" "node:assert" "node:buffer" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:net" "node:os" "node:path" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:zlib" "node:worker_threads" "undici" "ws" 
Elapsed: 1286ms | User: 234ms | Sys: 62ms
RSS: 0.29GB | Peak: 0.30GB | Commit: 0.36GB | Faults: 73844

panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.6/wr184d81c3AkghgwK+lh+0CuusvvC8+3ge49w9dgju9dkj+wG29x0uC44roF02ipF432tFA2DD

[nodemon] app crashed - waiting for file changes before starting...

Stack Trace (bun.report)

Bun v1.1.6 (84d81c3) on windows x86_64 [RunCommand]

Segmentation fault at address 0xFFFFFFFFFFFFFFFF

Features: Bun.stdin, fetch, transpiler_cache, tsconfig, WebSocket

@rederek64 rederek64 added bug Something isn't working crash An issue that could cause a crash labels May 10, 2024
@Jarred-Sumner Jarred-Sumner linked a pull request May 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash An issue that could cause a crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant