Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the experimental syntax 'classPrivateProperties' isn't currently enabled #84

Open
farsighted6 opened this issue Feb 27, 2022 · 1 comment

Comments

@farsighted6
Copy link

I enabled checkbox "ECMAScript 2022 (via babel-minify)" and get following error :

SyntaxError: unknown: Support for the experimental syntax 'classPrivateProperties' isn't currently enabled (2:3):

1 | class ClassWithPrivateField {

2 | #privateField;
| ^
3 | }
4 |
5 |

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.

More info on "#privateField" :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

@gheescoo
Copy link

Same. I have got used to C-style classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants