Reputation: 121
With Visual Studio 2022, I have a lot of IntelliSense errors in the error list window about type definitions of the node_modules folder.
In my tsconfig.json file, I excluded the node_modules folder : "exclude": ["node_modules"]
.
In my csproj, I added the line <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
.
But nothing works, I didn't succeed in removing these errors.
Upvotes: 6
Views: 1317
Reputation: 1578
It will depend on your tsconfig - can you share your setup? Will want to exclude your dist file as well as your node_modules (and if you want tests/spec files).
"exclude": ["node_modules", "**/*.spec.ts", "dist"]
Webpack has not exported member compilation was the error i saw first - what are you importing with that? Docs here for webpack and typescript.
Wondering if your types are discoverable, could try adding below to tsconfig
"typeRoots": [
"./node_modules/@types"
]
Upvotes: 0
Reputation: 1873
After lots of trial and error, I've gotten "exclude": ["./node_modules/**/*.*"]
to successfully ignore node_modules. It didn't take effect until I restarted Visual Studio.
Upvotes: 3