I'm trying to bundle my javascript files using parcel everything is going ok except that I get this problem when I run npm run start
@parcel/transformer-js: This experimental syntax requires enabling one of the following parser plugin(s): 'classPrivateProperties, classPrivateMethods'
after some googling I found out that I need to install the classPrivateProperties
and the classPrivateMethods
so I did but the same problem occuring here is my package.json
file
{
"name": "starter",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@babel/plugin-proposal-private-property-in-object": "^7.13.0",
"@parcel/optimizer-cssnano": "^2.0.0-nightly.612",
"@parcel/optimizer-htmlnano": "^2.0.0-nightly.612",
"@parcel/packager-css": "^2.0.0-nightly.612",
"@parcel/packager-html": "^2.0.0-nightly.612",
"@parcel/transformer-css": "^2.0.0-nightly.612",
"@parcel/transformer-html": "^2.0.0-nightly.612",
"@parcel/transformer-postcss": "^2.0.0-nightly.612",
"@parcel/transformer-posthtml": "^2.0.0-nightly.612",
"@parcel/transformer-sass": "^2.0.0-nightly.612",
"node": "^15.10.0",
"parcel": "^2.0.0-beta.1",
"postcss": "^8.2.6",
"sass": "^1.26.10"
},
"dependencies": {
"core-js": "^3.6.5",
"fractional": "^1.0.0",
"regenerator-runtime": "^0.13.7"
},
"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-private-property-in-object"
]
}
thanks for your help
I'm trying to bundle my javascript files using parcel everything is going ok except that I get this problem when I run npm run start
@parcel/transformer-js: This experimental syntax requires enabling one of the following parser plugin(s): 'classPrivateProperties, classPrivateMethods'
after some googling I found out that I need to install the classPrivateProperties
and the classPrivateMethods
so I did but the same problem occuring here is my package.json
file
{
"name": "starter",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@babel/plugin-proposal-private-property-in-object": "^7.13.0",
"@parcel/optimizer-cssnano": "^2.0.0-nightly.612",
"@parcel/optimizer-htmlnano": "^2.0.0-nightly.612",
"@parcel/packager-css": "^2.0.0-nightly.612",
"@parcel/packager-html": "^2.0.0-nightly.612",
"@parcel/transformer-css": "^2.0.0-nightly.612",
"@parcel/transformer-html": "^2.0.0-nightly.612",
"@parcel/transformer-postcss": "^2.0.0-nightly.612",
"@parcel/transformer-posthtml": "^2.0.0-nightly.612",
"@parcel/transformer-sass": "^2.0.0-nightly.612",
"node": "^15.10.0",
"parcel": "^2.0.0-beta.1",
"postcss": "^8.2.6",
"sass": "^1.26.10"
},
"dependencies": {
"core-js": "^3.6.5",
"fractional": "^1.0.0",
"regenerator-runtime": "^0.13.7"
},
"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-private-property-in-object"
]
}
thanks for your help
Share Improve this question asked Mar 2, 2021 at 12:45 Amine El wereAmine El were 8553 gold badges9 silver badges24 bronze badges2 Answers
Reset to default 4If you are talking about Parcel.js, you need to install and configure some Babel plugins, to enable Class Private Properties and Methods:
Install this packages with NPM:
npm i @babel/plugin-proposal-private-methods @babel/plugin-proposal-class-properties
Create the
.babelrc
file at the root folder of your project with this:
{
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
}
- Run Parcel again.
I solved this problem by installing the plugins and adding a .babelrc configuration file to the root of my project.
{
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
}