[TS] Command not found when trying to deploy commands after switching filter from .js to .ts

I have the deploy commands file from the guide in /src/util/deploy-commands.ts: https://hst.sh/ugubalayir.js running this works fine, however, when I change
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".js"))
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".js"))
to
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".ts"))
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".ts"))
I get the error that my ping command isn't found: https://hst.sh/yulitipaqe.js DJS v14.2.0 NODE v16.10.0
12 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
net-tech-
net-tech-OP3y ago
Already done
Dagan
Dagan3y ago
Is your ping file called ping.ts?
net-tech-
net-tech-OP3y ago
yes
Dagan
Dagan3y ago
What outputs commandFiles?
net-tech-
net-tech-OP3y ago
you mean what does commandFiles output when logged?
Dagan
Dagan3y ago
Yes
net-tech-
net-tech-OP3y ago
[ 'ping.ts' ]
Dagan
Dagan3y ago
So it doesnt skip it Oh ill look into the links you’ve sent didnt see them at first Weird Dunno srry
net-tech-
net-tech-OP3y ago
:/
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
souji
souji3y ago
even then, ofc it does. the compile step doesn't know it's switching the context and the path leads to the (compiled) js files so if you filter for ts it won't find anything this has hardly anything to do with discord.js, locking
Want results from more Discord servers?
Add your server