In the past couple of weeks I've ran into some cases where types aren't being inferred. This is happening rarely, but I never ran into it until recently.
For example,
const extList = productExtensionResArray[index].productExtendList
If I hover my mouse over the .productExtendList part it shows the proper type for it, but if I hover my mouse over the extList part it says it's any. This seems like a pretty straight forward type to infer, but it's just not doing it. 99% of the time it's working fine and inferring all my types, but every once in a while it just sets something to any, and I'm not sure what the conditions are for this to happen. I've tried reloading the project, restarting the TS server, and restarting VSCode. If I open the same code in WebStorm the type is inferred without issue.
Is anyone else experiencing this issue? Any known solutions?
tsconfig:
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"rootDir": "./",
"baseUrl": "./",
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"downlevelIteration": true,
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}