I have created a react app with a custom next server
server.js:
const { createServer } = require(\'http\');
const next = require(\'n
According to forums, the problem is caused because UglifyJs does not support ES6 so I tried to solve it with these links: this and this. I almost tried all the suggestion but none of them worked.
Instead of using UglifyJs, try using terser ! https://github.com/terser/terser
Uglify-js is able to transpile only es5 syntax. If you want to transpile es6+ syntax use terser instead.