Hello. Everything works fine in development, but when I change to production I got this:
Sortable.js:7 TypeError: Super expression must either be null or a function, not undefined
at react-draft-wysiwyg.js:6
at react-draft-wysiwyg.js:6
at react-draft-wysiwyg.js:6
at t.default (react-draft-wysiwyg.js:6)
at t.getCompositeDecorator (react-draft-wysiwyg.js:6)
at t.value (react-draft-wysiwyg.js:6)
at aa (react-dom.production.min.js:13)
at react-dom.production.min.js:13
at si (react-dom.production.min.js:13)
at ui (react-dom.production.min.js:13)
In production I use uglifyjs-webpack-plugin and that's the cause of the error and I don't really know why.
I get the same error...
I also get this error.
I solved it by using babel-minify-webpack-plugin instead of uglifyjs-webpack
I solved a similar issue by changing the uglify plugin's settings in the webpack config to not change fnames:
optimization:{
minimizer: [new UglifyJsPlugin({
uglifyOptions: {
compress: {
inline: 1,
keep_fnames: true
},
mangle: {
keep_fnames: true
}
}
})]
}
What worked for me here was to set the inline option for the compress option to false because by default it is true for the uglifyOptions.
optimization:{
minimizer: [new UglifyJsPlugin({
uglifyOptions: {
compress: {
inline: 1, // this right here
// keep_fnames: true
},
mangle: {
// keep_fnames: true
}
}
})]
}
Most helpful comment
I solved a similar issue by changing the uglify plugin's settings in the webpack config to not change fnames: