How to fix Missing class properties transform with react-sortablejs?

554 Views Asked by At

In an existing react project I installed react-soratablejs and it worked fine but later when I pulled the repo in some other place and did a npm install I started to get SyntaxError: ......./node_modules/react-sortablejs/dist/index.js: Missing class properties transform. I tried every solution suggested in this StackOverflow question too but with no success. following are my react and react-sortable js versions

"react": "^16.11.0",
"react-sortablejs": "^6.1.4",
"react-app-polyfill": "^1.0.4",
"devDependencies": {
"@babel/core": "^7.20.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6"
1

There are 1 best solutions below

0
On

I uninstalled the existing react-sortablejs npm package and installed it exaclty of version 6.0.0. That fixed the issue