TypeScript Intellisense is incredibly slow

I recently scaffolded a t3 app (manually, existing codebase) and found that the TypeScript Intellisense is incredibly slow. I am on a Macbook Air M1, and the only other thing running in the background is a Docker container housing a Postgres server. This makes it really hard to use TypeScript because I have to wait 10 seconds to get any autocomplete or intellisense. Copilot outpaces TypeScript by a good 5 seconds. I did some reading and heard that this could be caused by zod, but wanted to ask here first to see if anyone else has had similar problems. Here is my tsconfig.json, if that matters:
{
"compilerOptions": {
"target": "es2017",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"paths": {
"@/components/*": ["src/components/*"],
"@/server/*": ["src/server/*"],
"@/styles/*": ["src/styles/*"],
"@/public/*": ["public/*"],
"@/utils/*": ["src/utils/*"],
"env": ["src/env.mjs"]
},
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"noUncheckedIndexedAccess": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"],
"exclude": ["node_modules"]
}
{
"compilerOptions": {
"target": "es2017",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"paths": {
"@/components/*": ["src/components/*"],
"@/server/*": ["src/server/*"],
"@/styles/*": ["src/styles/*"],
"@/public/*": ["public/*"],
"@/utils/*": ["src/utils/*"],
"env": ["src/env.mjs"]
},
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"noUncheckedIndexedAccess": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.mjs"],
"exclude": ["node_modules"]
}
If you need a list of my extensions or something similar, let me know.
10 Replies
O2K
O2K•16mo ago
Try turning off all extensions and see if it gets faster, then you can turn them on one by one to debug I have an almost identical tsconfig.json and no issues 🤔
ethan
ethan•16mo ago
I’ve solved this and the problem was that strict was set to false. Does anybody know why, or workarounds so I can set it to false again.
dan
dan•16mo ago
imo you should have strict set to true in all cases.
cje
cje•16mo ago
its your punishment for setting strict to false
nexxel
nexxel•16mo ago
you should never set string to false especially in a t3 app where trpc requires you to have strict mode on
Lionbyte
Lionbyte•16mo ago
I have this exact some problem! Its so bad.,.. using Zod and Prisma-zod generator and man...it just stays in a loading state. I dont like this...any work around? Could it be the latest version of vscode causing problems?
isaac_way
isaac_way•16mo ago
Project references, avoiding using zod’s .extend, .omit, and .pick can help Also set ur vscode typescript version to latest
Lionbyte
Lionbyte•16mo ago
Hmmm… I need to investigate prisma-zod schema generator. It generates like 100 schema files. Ok I’ll try that.
isaac_way
isaac_way•16mo ago
It’s probably the generator lol
Lionbyte
Lionbyte•16mo ago
Ya I need to figure it out by removing it and see if it solves it.
Want results from more Discord servers?
Add your server
More Posts