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 toolkit3mo 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
Mark3mo ago
Lib version? TS version?
Shrewd 💫
Shrewd 💫OP3mo ago
I'll send my whole package json, moment just came back
Shrewd 💫
Shrewd 💫OP3mo ago
typescript is 5.7.2
No description
Shrewd 💫
Shrewd 💫OP3mo ago
I'll also mention I downgraded it to the one I used in my previous project, same issue.
NyR
NyR3mo ago
You may need to also install latest @types/node
Shrewd 💫
Shrewd 💫OP3mo ago
same issue. + @types/node ^22.10.2
girl pisser
girl pisser3mo ago
why is typescript not a dev dependency wouldn't be surprised if that was the issue
Shrewd 💫
Shrewd 💫OP3mo ago
never had it set as dev one and it worked
girl pisser
girl pisser3mo ago
maybe clean install deps?
Shrewd 💫
Shrewd 💫OP3mo ago
same issue I did it like three times already
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
girl pisser
girl pisser3mo ago
thats actually weird
Shrewd 💫
Shrewd 💫OP3mo ago
now it has worked..?
girl pisser
girl pisser3mo ago
yeah because that ignores dependency declarations
Shrewd 💫
Shrewd 💫OP3mo ago
oh yeah in my previous project my tsconfig had it like that too
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
megatank58
megatank583mo ago
what does your tsconfig look like
Shrewd 💫
Shrewd 💫OP3mo ago
current one?
megatank58
megatank583mo ago
yes
girl pisser
girl pisser3mo ago
oh tsc doesn't really like deps typings TIL
Shrewd 💫
Shrewd 💫OP3mo 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 pisser3mo ago
i guess these errors are related to the library ts version vs local one you're using
megatank58
megatank583mo ago
does it work if you set lib to es2023 (without skipLibCheck obv)
Shrewd 💫
Shrewd 💫OP3mo ago
you mean "target": "ES2023", right
megatank58
megatank583mo ago
no
Shrewd 💫
Shrewd 💫OP3mo ago
okay then guide me please here
NyR
NyR3mo 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
megatank583mo ago
lib = ["es2023"] yeah
Shrewd 💫
Shrewd 💫OP3mo ago
worked without skiplibcheck, yes
megatank58
megatank583mo ago
👍
Shrewd 💫
Shrewd 💫OP3mo ago
so should I stick with lib or skiplib
megatank58
megatank583mo 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
megatank583mo ago
i personally wouldnt use skipLibCheck unless necessary
Shrewd 💫
Shrewd 💫OP3mo ago
alright thank you all so much for help

Did you find this page helpful?