Issue with @sapphire/plugin-api
Hello,
I have installed @sapphire/plugin-api using the following command:
The install went fine, but intellisense is not showing "api" in my ClientOptions, instead I am getting this error:
This is my package.json :
I tried reinstalling my node modules.
Solution:Jump to solution
Try setting your module (and moduleResolution) to
node16
. They are the modern options for module stuff. Alternatively you can install and extend @sapphire/ts-config which will cover most of the config.
- All of those subselections of esnext
like esnext.array
are implied by esnext
so you're duplicating there
- exclude
isn't necessary like that. Exclude is to exclude something that was previously included, unless you have a node_modules
directory inside src
it does nothing
- You can change include
to just src
, tsc will automatically resolve the whole directory glob....4 Replies
Make sure you have
import '@sapphire/plugin-api/register
somewhere in your code. If you already do then please share your tsconfig.It's imported in my index.ts
Here is my tsconfig.json
Solution
Try setting your module (and moduleResolution) to
node16
. They are the modern options for module stuff. Alternatively you can install and extend @sapphire/ts-config which will cover most of the config.
- All of those subselections of esnext
like esnext.array
are implied by esnext
so you're duplicating there
- exclude
isn't necessary like that. Exclude is to exclude something that was previously included, unless you have a node_modules
directory inside src
it does nothing
- You can change include
to just src
, tsc will automatically resolve the whole directory glob.
- It is recommended to not enable skipLibCheck
when possible
- You should enable strict checking ("strict": true
) to get full and proper tsc checkingit works now, thank you