Every time I attempt to execute the code below that involves a private field, I encounter an "Invalid character" issue at the location of #
.
class MyClass {
#x = 10;
}
Here is the content of my tsconfig.json file:
{
"compilerOptions": {
"target": "esnext",
…
}
The error message I receive is as follows:
2:5 - error TS1127: Invalid character.
What could be causing this problem, and how can I go about resolving it?