TypeScript errors with MappedInteractionTypes
See original GitHub issueWhich package is this bug report for?
discord.js
Issue description
Note: This is not a duplicate of #7924, strictNullChecks
are enabled!
- Create a new project using
yarn init -y
- Install discord.js using
yarn add discord.js
- Install typescript and node-types using
yarn add -D typescript @types/node
- Create
tsconfig.json
andindex.ts
from the codesample - Run
yarn tsc --noEmit
- Observe errors in discord.js/typings/index.d.ts
A workaround for this is using skipLibCheck
but I’d rather not have to do that since I believe that including the libraries in typechecking is valuable to spot missing external dependencies (like polyfills for DOM API or WebSocket, etc).
One more note regarding the dev build (yarn add discord.js@dev
, version number down below): That one does not show the errors mentioned above but a handful other ones regarding the new Builders.
Code sample
`tsconfig.json`
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
/* Type Checking */
"strict": true,
"strictNullChecks": true,
"skipLibCheck": false
}
}
index.ts
import { Client } from "discord.js";
const client = new Client({ intents: [] });
client.login();
Package version
discord.js@14.6.0
Node.js version
Node: 16.13.1, TypeScript 4.8.4
Operating system
Windows 10; 64-bit
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
No Intents
I have tested this issue on a development release
ff85481
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Type `MappedInteractionTypes` Error · Issue #7383 - GitHub
I havent tried to get an error with this but i found out while walking on the types for djs that there is...
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >Interpreting Errors - TypeScript Deep Dive - Gitbook
This example demonstrates a common programmer error where they fail to call a function ( bar: getBar should be bar: getBar() ). Fortunately...
Read more >How to read TypeScript errors - HipsterBrown
These errors can occur at runtime, build time, or as feedback in editors while the code is being written. When seeing TypeScript errors...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No ETA sadly.
strictNullChecks
won’t do anything and one does not need to setskipLibCheck
totrue
. Simply override discord-api-types to 0.37.14 in your package.json:Any estimates when a new version without library internal typeerrors is going to be released?