Reputation:
When I try to run the following code that uses a private field, I get an "Invalid character" error at the position of #
.
class MyClass {
#x = 10;
}
This is my tsconfig.json:
{
"compilerOptions": {
"target": "esnext",
…
}
I get this error:
2:5 - error TS1127: Invalid character.
Why is that, and how can I fix it?
Upvotes: 0
Views: 1204