react-sortablejs icon indicating copy to clipboard operation
react-sortablejs copied to clipboard

[bug] Failed to compile.

Open sajera opened this issue 1 year ago • 15 comments

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

sajera avatar Jul 13 '22 13:07 sajera

same problem

1 error found.

ERROR in ./node_modules/.pnpm/[email protected]_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
|     };

eeve avatar Jul 18 '22 03:07 eeve

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

arigon avatar Jul 18 '22 08:07 arigon

same problem!how to resolve it?

izhangchao avatar Jul 21 '22 08:07 izhangchao

fallback to version 6.1.1

eeve avatar Jul 21 '22 12:07 eeve

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

seanemery1 avatar Jul 21 '22 18:07 seanemery1

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

LeonBlade avatar Jul 25 '22 21:07 LeonBlade

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

manuelsambade avatar Aug 12 '22 13:08 manuelsambade

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 avatar Aug 31 '22 13:08 welcomemax

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

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

welcomemax avatar Sep 01 '22 08:09 welcomemax

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

pokroman avatar Sep 01 '22 08:09 pokroman

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

welcomemax avatar Jan 26 '23 11:01 welcomemax

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

giabao2000 avatar Mar 09 '23 03:03 giabao2000

same issue +1

andy7076 avatar Jul 31 '23 01:07 andy7076

same issue +1

yangJinRui325 avatar Aug 21 '23 10:08 yangJinRui325

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

andreichirkov avatar Nov 30 '23 08:11 andreichirkov