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

Did you find this page helpful?