Enabling the parser plugin 'classProperties'
See original GitHub issueBug Report
docz dev
builds and works fine but docz build
throws SyntaxError: This experimental syntax requires enabling the parser plugin: 'classProperties'
.
I am using babel-plugin-transform-class-properties when i bundle my libraries and my doczrc.js
has added the @babel/plugins-syntax-transform-properties
SyntaxError: This experimental syntax requires enabling the parser plugin: 'classProperties' (7:12)
at _class.raise (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:3938:15)
at _class.expectPlugin (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:5252:18)
at _class.parseClassProperty (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:8102:12)
at _class.pushClassProperty (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:8066:30)
at _class.parseClassMemberWithIsStatic (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7999:14)
at _class.parseClassMember (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7936:10)
at _class.parseClassBody (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7891:12)
at _class.parseClass (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7841:10)
at _class.parseStatementContent (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7172:21)
at _class.parseStatement (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7144:17)
at _class.parseBlockOrModuleBlockBody (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7695:23)
at _class.parseBlockBody (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7682:10)
at _class.parseBlock (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:7671:10)
at _class.parseFunctionBody (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:6924:24)
at _class.parseArrowExpression (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:6876:10)
at _class.parseParenAndDistinguishExpression (/Users/jcarrick/Sites/react-common-components/packages/docs/node_modules/@babel/parser/lib/index.js:6492:12)
using docz@0.11.0
doczrc.js
const getRepoInfo = require('git-repo-info')
const tag = getRepoInfo().lastTag
export default {
title: 'React Component Library',
description: tag,
dest: `public`,
port: 9000,
theme: 'theme/Theme',
propsParser: false,
modifyBabelRc: babelrc => ({
...babelrc,
plugins: [
'@babel/plugin-syntax-class-properties',
'@babel/plugin-syntax-object-rest-spread',
'emotion',
...babelrc.plugins
]
})
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
This experimental syntax requires enabling the parser plugin ...
I have this issue as well, I do have '@babel/plugin-proposal-class-properties' in my babel.config.js and works elsewhere just fine. 2
Read more >This experimental syntax requires enabling one of the ...
If you are talking about Parcel.js, you need to install and configure some Babel plugins, to enable Class Private Properties and Methods:.
Read more >babel/plugin-syntax-class-properties
Syntax only. It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-proposal-class-properties...
Read more >this experimental syntax requires enabling the parser plugin
If you are talking about Parcel.js, you need to install and configure some Babel plugins, to enable Class Private Properties and Methods:.
Read more >How do I enable ESLint classPrivateMethods parser plugin?
[Solved]-How do I enable ESLint classPrivateMethods parser plugin?-babel.js · Install theses packages. @babel/plugin-proposal-class-properties; @babel/plugin- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Met this issue when using
arrow functions
for event binding in a class as a child ofPlayground
I am using typescript with DoczThis is still a valid bug, because using a class as a child of
Playground
is a valid option