complete-javascript-course
complete-javascript-course copied to clipboard
Private class issue
I’m trying to declare the private class and when i run the project this is the error @parcel/transformer-js: This experimental syntax requires enabling one of the following parser plugin(s): 'classPrivateProperties, classPrivateMethods' (2:4) an this is my json
{ "name": "licenta_carmen", "version": "1.0.0", "description": "Recipe application", "main": "index.html", "scripts": { "start": "parcel index.html", "build": "parcel build index.html" }, "author": "Melniciuc Carmen Andra", "license": "ISC", "devDependencies": { "@babel/plugin-proposal-private-methods": "^7.13.0", "@parcel/transformer-sass": "^2.0.0-beta.2", "parcel": "^2.0.0-beta.2" }, "dependencies": { "core-js": "^3.9.1", "regenerator-runtime": "^0.13.7" } }
Happened to me yesterday. I've been searching for 4h. You just need to create a new file inside main folder (where is the package.json) with the name .babelrc and insert this in it: { "plugins": [ "@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-private-methods" ] } Sper ca te ajuta :)
Happened to me yesterday. I've been searching for 4h. You just need to create a new file inside main folder (where is the package.json) with the name .babelrc and insert this in it: { "plugins": [ "@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-private-methods" ] } Sper ca te ajuta :)
Multumesc frumos! A mers. gasisesm pe net cateva chestii care imi indicau acelasi lucru dar nu intelegeam unde trebuiau aceste doua plugin-uri...
Multumesc frumos! A mers. gasisesm pe net cateva chestii care imi indicau acelasi lucru dar nu intelegeam unde trebuiau aceste doua plugin-uri...
Cu placere. Si mie mi-au iesit peri albi pana mi-am dat seama.
Hei,
I have the same issue, and I do not know how to solve it, Hope you guys can help me
My package.json looks like this:
{
"name": "forkify",
"version": "1.0.0",
"description": "Recipe app",
"main": "index.html",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"author": "Enio Marku",
"license": "ISC",
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@parcel/transformer-sass": "^2.0.0-beta.2",
"parcel": "^2.0.0-beta.2"
}
}
My configure.babelrc looks like this:
{
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
}
This file is in the same root directory as it is package.json. Do I need to include this file into the index.html?
add this to your file { "plugins": ["@babel/plugin-syntax-class-properties"] } your file is in the right place