question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: This experimental syntax requires enabling the parser plugin: 'classProperties' (118:33)

See original GitHub issue

when I install this plugin, vscode and prettier stop formatting with the above error

I’m using vscode 1.52.1, with typescript 4.1.2

the stack trace is this

at Object._raise (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:748:17)
	at Object.raiseWithData (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:741:17)
	at Object.expectPlugin (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:9106:18)
	at Object.parseClassProperty (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12722:12)
	at Object.parseClassProperty (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6968:18)
	at Object.pushClassProperty (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12690:30)
	at Object.parseClassMemberWithIsStatic (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12595:14)
	at Object.parseClassMemberWithIsStatic (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6856:11)
	at Object.parseClassMember (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12532:10)
	at callParseClassMember (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6820:13)
	at Object.parseClassMember (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6826:7)
	at /workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12477:14
	at Object.withTopicForbiddingContext (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11516:14)
	at Object.parseClassBody (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12454:10)
	at Object.parseClass (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12427:22)
	at Object.parseStatementContent (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11718:21)
	at Object.parseStatementContent (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6806:18)
	at Object.parseStatement (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11676:17)
	at Object.parseExportDeclaration (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12892:17)
	at Object.parseExportDeclaration (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6927:27)
	at Object.maybeParseExportDeclaration (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12848:31)
	at Object.parseExport (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12786:29)
	at Object.parseExport (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6769:20)
	at Object.parseStatementContent (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11782:27)
	at Object.parseStatementContent (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:6806:18)
	at Object.parseStatement (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11676:17)
	at Object.parseBlockOrModuleBlockBody (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12258:25)
	at Object.parseBlockBody (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:12249:10)
	at Object.parseTopLevel (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:11607:10)
	at Object.parse (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:13415:10)
	at Object.parse (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/parser/lib/index.js:13468:38)
	at Object.preprocessor [as preprocess] (/workspace/node_modules/@trivago/prettier-plugin-sort-imports/lib/src/preprocessor.js:21:24)```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:14

github_iconTop GitHub Comments

7reactions
bogdibotacommented, Jun 22, 2021

Adding this

  "experimentalBabelParserPluginsList": [
    "jsx",
    "typescript"
  ]

to .prettierrc solved the issue for me

5reactions
ziaulrehman40commented, Apr 22, 2021

Am I the only one still getting this error on latest verions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

This experimental syntax requires enabling one of the ...
I solved this problem by installing the plugins and adding a .babelrc configuration file to the root of my project.
Read more >
this experimental syntax requires enabling the parser plugin
This experimental syntax requires enabling one of the following parser plugin(s): 'classPrivateProperties, classPrivateMethods'.
Read more >
eslint/eslint - Gitter
Parsing error: This experimental syntax requires enabling the parser plugin: 'throwExpressions'. What plugin should I use?? I currently have below plugins ...
Read more >
[Error Debugging] This experimental syntax requires enabling ...
This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript'.
Read more >
babel/plugin-syntax-class-properties
@babel/plugin-syntax-class-properties. Syntax only. It's unlikely you want to use this plugin directly as it only enables Babel to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found