Conflicting types
I use the latest version of djs (14.14.1) and it seems like it has different types for taking the result from parsing.
Solution:Jump to solution
anyway if I write the code like this then it works fine:
```ts
import { ApplyOptions } from '@sapphire/decorators';
import { Awaitable, InteractionHandler, InteractionHandlerTypes, Option } from '@sapphire/framework';
import { AutocompleteInteraction, type ApplicationCommandOptionChoiceData } from 'discord.js';...
6 Replies
And as a result, Auto Completions are broken
Please share your package.json and lock file so the issue can be reproduced and analysed.
are you sure that's your packge.json entirely? you dont have typescript in there at all.
Solution
anyway if I write the code like this then it works fine:
That said, the explicit return type for
parse
is only required because of pnpm. When I install dependencies with npm or yarn then having it implicit is enough. This is just one more of the quirks of pnpm's way of doing pnp that isn't really compatible with the NodeJS ecosystem. If you use pnpm for its speed over npm we recommend looking into Yarn v4 which is just as fast if not faster. You can use /tag query: yarnv4
from @Spinel to get a copypasta about installing yarn v4.
At its core this problem probably stems from that pnpm does wacky stuff with how it puts dependencies in node_modules without patching typescript to ensure that it can properly process this. If you compare that to yarn's PnP mode (optional!!), there you HAVE to use a custom typescript wrapper otherwise it just straight up doesn't work. pnpm should do that same but I doubt they ever willI have ts installed globally.
I won't share my project anywhere cuz it's just for me personally, a kind of a test development bot process.
hm
Thanks, this way actually solved that issue.