npx tsc error

I never had this issue so I don't know what else to say
No description
35 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Mark
Mark5mo ago
Lib version? TS version?
Shrewd 💫
Shrewd 💫OP5mo ago
I'll send my whole package json, moment just came back
Shrewd 💫
Shrewd 💫OP5mo ago
typescript is 5.7.2
No description
Shrewd 💫
Shrewd 💫OP5mo ago
I'll also mention I downgraded it to the one I used in my previous project, same issue.
NyR
NyR5mo ago
You may need to also install latest @types/node
Shrewd 💫
Shrewd 💫OP5mo ago
same issue. + @types/node ^22.10.2
girl pisser
girl pisser5mo ago
why is typescript not a dev dependency wouldn't be surprised if that was the issue
Shrewd 💫
Shrewd 💫OP5mo ago
never had it set as dev one and it worked
girl pisser
girl pisser5mo ago
maybe clean install deps?
Shrewd 💫
Shrewd 💫OP5mo ago
same issue I did it like three times already
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
girl pisser
girl pisser5mo ago
thats actually weird
Shrewd 💫
Shrewd 💫OP5mo ago
now it has worked..?
girl pisser
girl pisser5mo ago
yeah because that ignores dependency declarations
Shrewd 💫
Shrewd 💫OP5mo ago
oh yeah in my previous project my tsconfig had it like that too
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
megatank58
megatank585mo ago
what does your tsconfig look like
Shrewd 💫
Shrewd 💫OP5mo ago
current one?
megatank58
megatank585mo ago
yes
girl pisser
girl pisser5mo ago
oh tsc doesn't really like deps typings TIL
Shrewd 💫
Shrewd 💫OP5mo ago
{
"extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict", "@sapphire/ts-config/decorators"],
"compilerOptions": {
"skipLibCheck": true,
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
{
"extends": ["@sapphire/ts-config", "@sapphire/ts-config/extra-strict", "@sapphire/ts-config/decorators"],
"compilerOptions": {
"skipLibCheck": true,
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
girl pisser
girl pisser5mo ago
i guess these errors are related to the library ts version vs local one you're using
megatank58
megatank585mo ago
does it work if you set lib to es2023 (without skipLibCheck obv)
Shrewd 💫
Shrewd 💫OP5mo ago
you mean "target": "ES2023", right
megatank58
megatank585mo ago
no
Shrewd 💫
Shrewd 💫OP5mo ago
okay then guide me please here
NyR
NyR5mo ago
Latest node types changed the iterators types...hence the error. There were some pr on DefinitelyTyped to address this, though it's status is kinda unknown
megatank58
megatank585mo ago
lib = ["es2023"] yeah
Shrewd 💫
Shrewd 💫OP5mo ago
worked without skiplibcheck, yes
megatank58
megatank585mo ago
👍
Shrewd 💫
Shrewd 💫OP5mo ago
so should I stick with lib or skiplib
megatank58
megatank585mo ago
TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
megatank58
megatank585mo ago
i personally wouldnt use skipLibCheck unless necessary
Shrewd 💫
Shrewd 💫OP5mo ago
alright thank you all so much for help

Did you find this page helpful?