React-sortable-hoc: Error appears in a production build

Created on 30 Nov 2017  路  9Comments  路  Source: clauderic/react-sortable-hoc

Hi
Everything works nice in dev. build, but when building for production (NODE_ENV=production) dnd doesn't work. I'm able to pick a draghandle but every single px moved produces the following error:

(22)  index.js:593 Uncaught ReferenceError: a43326 is not defined
    at n.value (index.js:593)
    at t.handleSortMove (index.js:272)

Most helpful comment

@ambewas disabled hoist_props and it worked! great! thanks guys!

All 9 comments

Same with me! Dev works great, prod brings error @rasdaniil mentioned. If not mangle the names, its deltaScroll is not defined. Uglify adds the problem. Anyway to solve it ?

Same here, but different number -> a118076 is not defined

btw, I've tried to build without uglifying (webpack plugin) - it works, though it doesn't solve the issue

@midan888 @ambewas I've found the solution that works at least in my case: replaced new UglifyJSPlugin() with new webpack.optimize.UglifyJsPlugin()

@rasdaniil am I correct in assuming this is an issue with some latest release of uglifyJS ?

We're using browserify in our project so unfortunately this proposed solution doesn't work for us. I'm going to try to fix a previous version of uglifyJS if possible (using gulp-uglify....)

edit -> gulp-uglify allows minor/patch updates of uglifyJS, so getting a fixed version is not going to work :/

@rasdaniil thanks for the tip! I actually can't use new webpack.optimize.UglifyJsPlugin() because it uses some old uglifyjs version, which breaks my code, I rolling back to find version that works for me.

@ambewas I'm not quite sure, but it looks like the newer uglify plugin (which I had initially) uses something called UglifyJS v3 (uglify-es) to minify your JavaScript which is obviously somehow wrapped around es modules against the old plugin which was not. Is this what actually breaks the sortable-hoc or not I can't say for sure, but hope this information will help somehow :)

I've opened up an issue with uglifyJS https://github.com/mishoo/UglifyJS2/issues/2540

let's see what comes out of that. Their latest release 3.2.0 could be the one that breaks things here.

@ambewas disabled hoist_props and it worked! great! thanks guys!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

botoxparty picture botoxparty  路  3Comments

sammiwei911 picture sammiwei911  路  3Comments

zaygraveyard picture zaygraveyard  路  3Comments

ashishtechuz picture ashishtechuz  路  4Comments

ccharliemagne picture ccharliemagne  路  3Comments