JavaScript
JavaScript private field syntax was used outside a class body
JavaScript encountered private field syntax in a location where class private names are not allowed.
JavaScript
JavaScript encountered private field syntax in a location where class private names are not allowed.
Observed message
SyntaxError: Unexpected '#' used outside of class body
Why it happens
How to fix it
Official reference
MDN: SyntaxError: Unexpected # used outside of class bodyRelated errors
Explore more