React-dnd: update to autobind-decorator breaks react-dnd-html5-backend when minifying with uglify and babel

Created on 5 Nov 2018  ·  5Comments  ·  Source: react-dnd/react-dnd

Running a production build with create react app is broken due to the latest change to autobind-decorator (2.2.1) conflicting with react-dnd-html5-backend

babel 6
screen shot 2018-11-05 at 9 43 05 am

babel 7
screen shot 2018-11-05 at 9 47 50 am

awaiting release

Most helpful comment

  "dependencies": {
    "react": "^16.3.2",
    "react-dnd": "^5.0.0",
    "react-dnd-html5-backend": "4.0.6",
    "autobind-decorator": "2.1.0",
  },

if you install autobind-decorator pinned at 2.1.0 after you install react-dnd-html5-backen it should work.

Or alternatively just npm install [email protected]

All 5 comments

Recent commits to this project remove the autobind-decorator and replace it with bound class-member semantics. I want to take a pass through the PRs and then I'll cut a release afterwards.

Is there any workaround in the meantime?

  "dependencies": {
    "react": "^16.3.2",
    "react-dnd": "^5.0.0",
    "react-dnd-html5-backend": "4.0.6",
    "autobind-decorator": "2.1.0",
  },

if you install autobind-decorator pinned at 2.1.0 after you install react-dnd-html5-backen it should work.

Or alternatively just npm install [email protected]

@darthtrevino thanks for the update!

For those using yarn, the workaround is to go to yarn.lock and replace

autobind-decorator@^2.1.0:
  version "2.3.1"
  resolved "https://registry.yarnpkg.com/autobind-decorator/-/autobind-decorator-2.3.1.tgz#d7ef8b752d6874ffe713f45431018a6565f9e8da"

with

autobind-decorator@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/autobind-decorator/-/autobind-decorator-2.1.0.tgz#4451240dbfeff46361c506575a63ed40f0e5bc68"

And then run yarn.

It will reset on every yarn upgrade/add/whatever console command so re-apply the fix.

Was this page helpful?
0 / 5 - 0 ratings