Piece not loading when stores.register() is called

Code: https://github.com/UTCSheffield/olp-nixos-config/tree/Sean/Upgrade-tool/update-tool/server I'm using pieces without framework as it's not for a bot, When I call container.stores.register(new MessageStore()) no paths get populated and it never loads a piece, when it should be loading 1 Typescript version: 5.5.4 Pieces version: 4.3.1 Node: 20.16.0 Any ideas?
GitHub
olp-nixos-config/update-tool/server at Sean/Upgrade-tool · UTCSheff...
School's Nixos config. Contribute to UTCSheffield/olp-nixos-config development by creating an account on GitHub.
Solution:
You're missing container.stores.registerPath() to set up the path, followed by await container.stores.load(); to load the pieces.
Jump to solution
6 Replies
Solution
kyra
kyra3mo ago
You're missing container.stores.registerPath() to set up the path, followed by await container.stores.load(); to load the pieces.
Sean
Sean3mo ago
Oh, I didn't have to do that the last time I used pieces, It might have been framework doing it for me though
kyra
kyra3mo ago
Framework does many things for you, yes
Sean
Sean3mo ago
Another quick question, Im getting this error when I try and load a piece, I don't depend on discord.js anywhere though, so I'm confused on where it's coming from (Also that path is wrong but it seems to find it ok
Error when loading 'C:\Users\outra\olp-nixos-config\update-tool\server\dist\messages\currentVersion.js': file:///C:/Users/outra/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:3
import { MessagePayload, MessageEmbed, Permissions } from 'discord.js';
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async MessageLoaderStrategy.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:45:20)
at async MessageStore.loadPath (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:270:26)
at async MessageStore.loadAll (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:185:24)
at async Promise.all (index 0)
at async _StoreRegistry.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/StoreRegistry.mjs:28:5)
at async file:///C:/Users/outra/olp-nixos-config/update-tool/server/dist/index.js:13:1
Error when loading 'C:\Users\outra\olp-nixos-config\update-tool\server\dist\messages\currentVersion.js': file:///C:/Users/outra/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:3
import { MessagePayload, MessageEmbed, Permissions } from 'discord.js';
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async MessageLoaderStrategy.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:45:20)
at async MessageStore.loadPath (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:270:26)
at async MessageStore.loadAll (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:185:24)
at async Promise.all (index 0)
at async _StoreRegistry.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/StoreRegistry.mjs:28:5)
at async file:///C:/Users/outra/olp-nixos-config/update-tool/server/dist/index.js:13:1
kyra
kyra3mo ago
@sapphire/discord.js-utilities relies on discord.js, anyways, that's unrelated to this thread.
Favna
Favna3mo ago
maybe check out how I set it up here: https://github.com/favware/discord-application-emojis-manager which also uses pieces w/o framework FWIW I dont use registerPath but then I also exclusively use virtual pieces
Want results from more Discord servers?
Add your server