TypeError piece.aliases not iterable

When my bot is logging in, it is being prevented by this error below. I tried deleting my node_modules and reinstalling but the same thing happens. Obviously the error can't be in the framework, any idea how I can get past this? error:
2022-12-07 16:46:11 - ERROR - TypeError: piece.aliases is not iterable
2022-12-07 16:46:11 - ERROR - at CommandStore.insert (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/pieces/dist/lib/structures/AliasStore.js:58:33)
2022-12-07 16:46:11 - ERROR - at CommandStore.loadAll (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/pieces/dist/lib/structures/Store.js:139:24)
2022-12-07 16:46:11 - ERROR - at async CommandStore.loadAll (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/framework/dist/lib/structures/CommandStore.js:38:5)
2022-12-07 16:46:11 - ERROR - at async Promise.all (index 1)
2022-12-07 16:46:11 - ERROR - at async BeholderClient.login (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/framework/dist/lib/SapphireClient.js:65:5)
2022-12-07 16:46:11 - ERROR - TypeError: piece.aliases is not iterable
2022-12-07 16:46:11 - ERROR - at CommandStore.insert (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/pieces/dist/lib/structures/AliasStore.js:58:33)
2022-12-07 16:46:11 - ERROR - at CommandStore.loadAll (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/pieces/dist/lib/structures/Store.js:139:24)
2022-12-07 16:46:11 - ERROR - at async CommandStore.loadAll (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/framework/dist/lib/structures/CommandStore.js:38:5)
2022-12-07 16:46:11 - ERROR - at async Promise.all (index 1)
2022-12-07 16:46:11 - ERROR - at async BeholderClient.login (/Users/whacktop/Engrimoore/Beholder/node_modules/@sapphire/framework/dist/lib/SapphireClient.js:65:5)
package.json
{
"name": "beholder",
"version": "8.0.0",
"description": "A bot used to manage and interact with the D&D 5e Discord Server Engrimoore.",
"author": "Engrimoore Code Weavers",
"license": "Apache-2.0",
"main": "dist/beholder.js",
"private": true,
"type": "commonjs",
"dependencies": {
"@sapphire/decorators": "^5.0.0",
"@sapphire/discord-utilities": "^2.12.0",
"@sapphire/discord.js-utilities": "^5.1.2",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "^3.1.4",
"@sapphire/plugin-api": "next",
"@sapphire/plugin-editable-commands": "next",
"@sapphire/plugin-logger": "^3.0.1",
"@sapphire/plugin-subcommands": "next",
"@sapphire/time-utilities": "^1.7.8",
"@sapphire/type": "^2.2.6",
"@sapphire/utilities": "^3.11.0",
"@skyra/env-utilities": "^1.1.0",
"colorette": "^2.0.19",
"discord-api-types": "^0.33.5",
"discord.js": "^13.12.0",
"dotenv-cra": "^3.0.2",
"mongoose": "^6.7.5",
"reflect-metadata": "^0.1.13",
"@discordjs/builders": "^0.16.0",
"@sapphire/plugin-scheduled-tasks": "^6.0.0",
"@sapphire/snowflake": "^3.3.0",
"@sapphire/stopwatch": "^1.5.0",
"ws": "^8.11.0"
},
"devDependencies": {
"@sapphire/prettier-config": "^1.4.4",
"@sapphire/ts-config": "^3.3.4",
"@types/node": "^18.11.10",
"@types/ws": "^8.5.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.0",
"tsc-watch": "^5.0.3",
"typescript": "^4.9.3"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/beholder.js",
"dev": "run-s build start",
"watch:start": "tsc-watch --onSuccess \"node ./dist/beholder.js\"",
"format": "prettier --write \"src/**/*.ts\""
},
"prettier": "@sapphire/prettier-config"
}
{
"name": "beholder",
"version": "8.0.0",
"description": "A bot used to manage and interact with the D&D 5e Discord Server Engrimoore.",
"author": "Engrimoore Code Weavers",
"license": "Apache-2.0",
"main": "dist/beholder.js",
"private": true,
"type": "commonjs",
"dependencies": {
"@sapphire/decorators": "^5.0.0",
"@sapphire/discord-utilities": "^2.12.0",
"@sapphire/discord.js-utilities": "^5.1.2",
"@sapphire/fetch": "^2.4.1",
"@sapphire/framework": "^3.1.4",
"@sapphire/plugin-api": "next",
"@sapphire/plugin-editable-commands": "next",
"@sapphire/plugin-logger": "^3.0.1",
"@sapphire/plugin-subcommands": "next",
"@sapphire/time-utilities": "^1.7.8",
"@sapphire/type": "^2.2.6",
"@sapphire/utilities": "^3.11.0",
"@skyra/env-utilities": "^1.1.0",
"colorette": "^2.0.19",
"discord-api-types": "^0.33.5",
"discord.js": "^13.12.0",
"dotenv-cra": "^3.0.2",
"mongoose": "^6.7.5",
"reflect-metadata": "^0.1.13",
"@discordjs/builders": "^0.16.0",
"@sapphire/plugin-scheduled-tasks": "^6.0.0",
"@sapphire/snowflake": "^3.3.0",
"@sapphire/stopwatch": "^1.5.0",
"ws": "^8.11.0"
},
"devDependencies": {
"@sapphire/prettier-config": "^1.4.4",
"@sapphire/ts-config": "^3.3.4",
"@types/node": "^18.11.10",
"@types/ws": "^8.5.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.0",
"tsc-watch": "^5.0.3",
"typescript": "^4.9.3"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "node dist/beholder.js",
"dev": "run-s build start",
"watch:start": "tsc-watch --onSuccess \"node ./dist/beholder.js\"",
"format": "prettier --write \"src/**/*.ts\""
},
"prettier": "@sapphire/prettier-config"
}
9 Replies
Favna
Favna2y ago
You have non-command files in your commands folder And after moving them make sure you remove dist and rebuild because typescript doesn't automatically remove files
WhacK
WhacKOP2y ago
Thank you I checked that. You are right I did use to but I found out through help here that I can’t change the name of the folder. I split out the non command files before encountering this error. I did delete dist and rebuild too. Is there something else it might be? I checked that I changed the sapphirerc.json from the custom folder name to ‘commands’
Favna
Favna2y ago
Upload code to GH or something that's easiest way to tell
WhacK
WhacKOP2y ago
I thought if I did this I would stop the command from being registered in the other guild. I coded this bot with slightly functionality in commonjs for our dnd server. We use that bot in production currently even though we are going to improve it over time. I set up an exact replica of our discord server. I thought this would: - allow me to leave the production bot running and not have the dev commands show up in the real server for development - only publish the commands when ready to the production branch which would then publish them in the real discord server https://www.sapphirejs.dev/docs/Guide/application-commands/application-command-registry/registering-chat-input-commands#guildids This made me think that it would only publish in the one given.
Sapphire Framework
Registering Chat Input Commands | Sapphire
To register a Chat Input Command (also known as a Slash Command) with Discord, you need to acquire an application
WhacK
WhacKOP2y ago
that's an accident thank you. I am refactoring this to typescript and I missed removing that. I'm not great at this unfortunately but I do try to use Dragonite as an example along with all the guides
Krish
Krish2y ago
instead, you can just use two bots, one for development and one for production so you do not have to worry about under-development commands getting deployed and idHints can contain the IDs of the respective slash commands for both the bots in the form of an array anyways not providing any ID will NOT prevent sapphire from registering the command so did it fix the error?
WhacK
WhacKOP2y ago
Ok thank you I’ll change that I got it removed will check it This did not fix it.
Want results from more Discord servers?
Add your server