Skip to content

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

@farsighted6

Description

@farsighted6

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions