☆彡
☆彡
SIASapphire - Imagine a framework
Created by ☆彡 on 7/20/2024 in #sapphire-support
Errors loading Commands and Listeners on bun run
When trying to run application via bun run, receive errors for each command and listener created. Here the following error:
Error when loading '/home/thrump/projects/botc/src/commands/createChannel.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [/home/thrump/projects/botc/src/commands/createChannel.ts]
path: "/home/thrump/projects/botc/src/commands/createChannel.ts"
at new LoaderError (/home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/errors/LoaderError.mjs:14:5)
at new MissingExportsError (/home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/errors/MissingExportsError.mjs:6:5)
at /home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:57:13
Error when loading '/home/thrump/projects/botc/src/commands/createChannel.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [/home/thrump/projects/botc/src/commands/createChannel.ts]
path: "/home/thrump/projects/botc/src/commands/createChannel.ts"
at new LoaderError (/home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/errors/LoaderError.mjs:14:5)
at new MissingExportsError (/home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/errors/MissingExportsError.mjs:6:5)
at /home/thrump/projects/botc/node_modules/.deno/@[email protected]/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:57:13
Here is an example of a file (very barebone):
import { isMessageInstance } from "@sapphire/discord.js-utilities";
import { Command } from "@sapphire/framework";

export class CreateChannelsCommand extends Command {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, { ...options });
}

public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("createChannels")
.setDescription("Will create individual channels for each player")
);
}

public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
console.log("test");
}
}
import { isMessageInstance } from "@sapphire/discord.js-utilities";
import { Command } from "@sapphire/framework";

export class CreateChannelsCommand extends Command {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, { ...options });
}

public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName("createChannels")
.setDescription("Will create individual channels for each player")
);
}

public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
console.log("test");
}
}
19 replies