I am following an example in this github repository
My code is
const TYPES = {
UserService: Symbol("UserService")
};
export default TYPES;
Visual studio code intellisense gives the following error for the above code.
message: 'Cannot invoke an expression whose type lacks a call signature. Type 'SymbolConstructor' has no compatible call signatures.' at: '3,18' source: 'ts'
Symbol definition
interface SymbolConstructor {
readonly iterator: symbol;
}
declare var Symbol: SymbolConstructor;
This symbol definition is defined in @types/node index.d.ts. When I navigate to the Symbol definition through visual studio code intellisense it took me to the file @types/node index.d.ts.
I just copy paste the code from the repository which I mentioned earlier. So there is no change. I also checked the packages which I installed just to make sure that I installed everything which is there in the repo. Everything looks same.
I am very new to typescript. I looked into some of these links
link 1 and link 2. But I am not able to understand that. Can anyone please clarify on this why this error is coming ?