Version mismatch between Sapphire and dapi-types
Hi, I was updating my dependencies when I encountered Discord.js' dapi-types error.
I copy/pasted their solution in my package.json (https://discord.com/channels/222078108977594368/769862166131245066/1076213839990894604)
Which fixed all the Typescript's compilation errors.
But now I have a runtime error with Sapphire failing to resolve dapi-types :
Versions of relevant deps (everything is latest from NPM) :
What should I do to fix this runtime error ? 😄
Thanks
Solution:Jump to solution
Because if so refer to https://discord.com/channels/222078108977594368/769862166131245066/1076213839990894604 and in your own code add proper checks using
!isStageChannel (...)
7 Replies
Remove the overrides then run
npm dedupe
. Everything is in the ^0.37.x
range.Thanks a lot, but now all the Discord.js' typescript compilation error are back
I removed package-json and node-modules to regenerate a clean dep tree, installed everything, then ran npm dedupe
As a temporary fix, i kept the overrides and went back to
Wait are you talking about send not being a function?
With the initial post
Solution
Because if so refer to https://discord.com/channels/222078108977594368/769862166131245066/1076213839990894604 and in your own code add proper checks using
!isStageChannel (...)
At any rate you should be able to use the latest dapi types if you also use latest djs sapphire. We fixed the send issue. This also hasn't been reported before. Not with npm users not yarn users.
my errors are all those :
I see what you mean, it seems like I need to add those manual checks everywhere
Thanks for your fast response
After thinking about it, I won't be doing that, i'll just stick with the older versions.
Because StageChannel do have a chat in Discord, and Djs just merged a PR that adds the
messages
property to Stage Channel, so i'll just wait for that to land, rather than adding a stage-channel guard everywhere, and removing it the next time i update Djs