SortableJS / react-sortablejs

React bindings for SortableJS
http://sortablejs.github.io/react-sortablejs/
MIT License
2.05k stars 209 forks source link

[bug] Failed to compile. #244

Open sajera opened 2 years ago

sajera commented 2 years ago

Failed to compile.

To Reproduce npm i react-sortablejs

Expected behavior All work fine

Information

image

Versions - Look in your package.json for this information: react-sortable = ^6.1.4 react = ^16.13.1

Additional context

I'm submitting a bug report

Webpack Version: 4.44.1

Babel Core Version: 7.4.5

Babel Loader Version: 8.0.6

Please tell us about your environment: OSX 12.4

eeve commented 2 years ago

same problem

1 error found.

ERROR in ./node_modules/.pnpm/react-sortablejs@6.1.4_n44kum6kqnww4ip7bq4mbkucqa/node_modules/react-sortablejs/dist/index.js 160:55
Module parse failed: Unexpected token (160:55)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| };
| class $7fe8e3ea572bda7a$export$11bbed9ee0012c13 extends (0, $8zHUo$react.Component) {
>     /* eslint-disable-next-line */ static defaultProps = {
|         clone: (item)=>item
|     };
arigon commented 2 years ago

It's part of SortableJS: https://github.com/SortableJS/Sortable/issues/2167

izhangchao commented 2 years ago

same problem!how to resolve it?

eeve commented 2 years ago

fallback to version 6.1.1

seanemery1 commented 2 years ago

downgrading to react-sortablejs v6.1.1 worked for me!

LeonBlade commented 2 years ago

We have this issue as well. Are there any plans on resolving this to use future version of this library? Thank you.

manuelsambade commented 2 years ago

This issue still persists. I need to work with 6.1.4 because I'm already using react 18.

Do you have any solution for this besides downgrading to 6.1.1?

Thanks

welcomemax commented 2 years ago

You need to add .babelrc to compile class props during build

  {
    "plugins": ["@babel/plugin-proposal-class-properties"]
  }

I can’t build and check anything locally because you have complete chaos with dependencies (lock file is absolutely required)

welcomemax commented 2 years ago

Dealt with versions and build (lock file is absolutely required)

Please see the new PR - https://github.com/SortableJS/react-sortablejs/pull/247

pokroman commented 2 years ago

Same problem!!! Please, resolve it as soon as possible!

welcomemax commented 1 year ago

Any update? Or the project is not maintained anymore? Looks like we're should migrate to beautiful-dnd)

giabao2000 commented 1 year ago

Reference: https://polotno.com/docs/non-react-integration npm install parcel polotno react react-dom

I try to install polotno in nuxt 2 project but error Failed to compile

Please, help me! Thanks

"canvas": "^2.11.0",
"nuxt": "^2.15.8",
"parcel": "^2.8.3",
"polotno": "^1.7.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-sortablejs": "^6.1.1",
"sortablejs": "^1.15.0",

image

andy7076 commented 1 year ago

same issue +1

yangJinRui325 commented 1 year ago

same issue +1

andreichirkov commented 11 months ago

Downgrading to 6.1.1 worked! ✅ "react-sortablejs": "6.1.1" ❌ "react-sortablejs": "^6.1.1"