Actionhero build failing with unexpected token error
up vote
0
down vote
favorite
I am working on a React JS project where I have used ActionHero as a server.
On the localhost, everything is working fine, but when I tried to build the project locally I go this error message.
vishal@vishal-pc:~/projects/x1-platform$ yarn run build
yarn run v1.12.3
warning package.json: No license field
warning ../../package.json: No license field
$ next build
> Using external babel configuration
> Location: "/home/vishal/projects/x1-platform/.babelrc"
> Using "webpack" config function defined in next.config.js.
> Failed to build on /tmp/c7a64326-b0fb-42d4-8537-3e83712fee01
{ Error: commons.js from UglifyJs
Unexpected token: punc ()) [commons.js:83270,22]
at /home/ampcome/projects/x1-platform/node_modules/next/dist/server/build/index.js:183:21
at emitRecords.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:368:12)
at next (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:354:15)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:1064:13)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:969:16
at /home/ampcome/projects/x1-platform/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:141:20)
errors:
[ 'commons.js from UglifyJsnUnexpected token: punc ()) [commons.js:83270,22]' ],
warnings: }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
next.config.js file
const path = require('path');
const merge = require('lodash.merge');
const glob = require('glob')
const Uglify = require('uglifyjs-webpack-plugin');
module.exports = {
webpack: (config) => {
config.resolve = merge({}, config.resolve, {
alias: {
Components: path.resolve(__dirname, 'components'),
Libs: path.resolve(__dirname, 'libs'),
Sagas: path.resolve(__dirname, 'sagas'),
},
});
config.module.rules.push(
{
test: /.(css|scss)/,
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
}
,
{
test: /.css$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader']
}
,
{
test: /.css$/,
loaders: [
'style-loader',
'css-loader'
]
},
{
test: /.s(a|c)ss$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader',
{ loader: 'sass-loader',
options: {
includePaths: ['scss', 'node_modules','styles']
.map((d) => path.join(__dirname, d))
.map((g) => glob.sync(g))
.reduce((a, c) => a.concat(c), )
}
}
]
}
)
config.node = {
fs: 'empty',
};
return config;
},
};
There are a lot of solutions given on the StackOverflow for this problem, but none of them are working for me.
I tried deactivating the Uglify plugin but that too is not working.
reactjs yarnpkg uglifyjs actionhero
add a comment |
up vote
0
down vote
favorite
I am working on a React JS project where I have used ActionHero as a server.
On the localhost, everything is working fine, but when I tried to build the project locally I go this error message.
vishal@vishal-pc:~/projects/x1-platform$ yarn run build
yarn run v1.12.3
warning package.json: No license field
warning ../../package.json: No license field
$ next build
> Using external babel configuration
> Location: "/home/vishal/projects/x1-platform/.babelrc"
> Using "webpack" config function defined in next.config.js.
> Failed to build on /tmp/c7a64326-b0fb-42d4-8537-3e83712fee01
{ Error: commons.js from UglifyJs
Unexpected token: punc ()) [commons.js:83270,22]
at /home/ampcome/projects/x1-platform/node_modules/next/dist/server/build/index.js:183:21
at emitRecords.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:368:12)
at next (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:354:15)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:1064:13)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:969:16
at /home/ampcome/projects/x1-platform/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:141:20)
errors:
[ 'commons.js from UglifyJsnUnexpected token: punc ()) [commons.js:83270,22]' ],
warnings: }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
next.config.js file
const path = require('path');
const merge = require('lodash.merge');
const glob = require('glob')
const Uglify = require('uglifyjs-webpack-plugin');
module.exports = {
webpack: (config) => {
config.resolve = merge({}, config.resolve, {
alias: {
Components: path.resolve(__dirname, 'components'),
Libs: path.resolve(__dirname, 'libs'),
Sagas: path.resolve(__dirname, 'sagas'),
},
});
config.module.rules.push(
{
test: /.(css|scss)/,
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
}
,
{
test: /.css$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader']
}
,
{
test: /.css$/,
loaders: [
'style-loader',
'css-loader'
]
},
{
test: /.s(a|c)ss$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader',
{ loader: 'sass-loader',
options: {
includePaths: ['scss', 'node_modules','styles']
.map((d) => path.join(__dirname, d))
.map((g) => glob.sync(g))
.reduce((a, c) => a.concat(c), )
}
}
]
}
)
config.node = {
fs: 'empty',
};
return config;
},
};
There are a lot of solutions given on the StackOverflow for this problem, but none of them are working for me.
I tried deactivating the Uglify plugin but that too is not working.
reactjs yarnpkg uglifyjs actionhero
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am working on a React JS project where I have used ActionHero as a server.
On the localhost, everything is working fine, but when I tried to build the project locally I go this error message.
vishal@vishal-pc:~/projects/x1-platform$ yarn run build
yarn run v1.12.3
warning package.json: No license field
warning ../../package.json: No license field
$ next build
> Using external babel configuration
> Location: "/home/vishal/projects/x1-platform/.babelrc"
> Using "webpack" config function defined in next.config.js.
> Failed to build on /tmp/c7a64326-b0fb-42d4-8537-3e83712fee01
{ Error: commons.js from UglifyJs
Unexpected token: punc ()) [commons.js:83270,22]
at /home/ampcome/projects/x1-platform/node_modules/next/dist/server/build/index.js:183:21
at emitRecords.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:368:12)
at next (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:354:15)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:1064:13)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:969:16
at /home/ampcome/projects/x1-platform/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:141:20)
errors:
[ 'commons.js from UglifyJsnUnexpected token: punc ()) [commons.js:83270,22]' ],
warnings: }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
next.config.js file
const path = require('path');
const merge = require('lodash.merge');
const glob = require('glob')
const Uglify = require('uglifyjs-webpack-plugin');
module.exports = {
webpack: (config) => {
config.resolve = merge({}, config.resolve, {
alias: {
Components: path.resolve(__dirname, 'components'),
Libs: path.resolve(__dirname, 'libs'),
Sagas: path.resolve(__dirname, 'sagas'),
},
});
config.module.rules.push(
{
test: /.(css|scss)/,
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
}
,
{
test: /.css$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader']
}
,
{
test: /.css$/,
loaders: [
'style-loader',
'css-loader'
]
},
{
test: /.s(a|c)ss$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader',
{ loader: 'sass-loader',
options: {
includePaths: ['scss', 'node_modules','styles']
.map((d) => path.join(__dirname, d))
.map((g) => glob.sync(g))
.reduce((a, c) => a.concat(c), )
}
}
]
}
)
config.node = {
fs: 'empty',
};
return config;
},
};
There are a lot of solutions given on the StackOverflow for this problem, but none of them are working for me.
I tried deactivating the Uglify plugin but that too is not working.
reactjs yarnpkg uglifyjs actionhero
I am working on a React JS project where I have used ActionHero as a server.
On the localhost, everything is working fine, but when I tried to build the project locally I go this error message.
vishal@vishal-pc:~/projects/x1-platform$ yarn run build
yarn run v1.12.3
warning package.json: No license field
warning ../../package.json: No license field
$ next build
> Using external babel configuration
> Location: "/home/vishal/projects/x1-platform/.babelrc"
> Using "webpack" config function defined in next.config.js.
> Failed to build on /tmp/c7a64326-b0fb-42d4-8537-3e83712fee01
{ Error: commons.js from UglifyJs
Unexpected token: punc ()) [commons.js:83270,22]
at /home/ampcome/projects/x1-platform/node_modules/next/dist/server/build/index.js:183:21
at emitRecords.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:368:12)
at next (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/ampcome/projects/x1-platform/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:365:9)
at require.forEach.err (/home/ampcome/projects/x1-platform/node_modules/webpack/lib/Compiler.js:354:15)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:473:16
at iteratorCallback (/home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:1064:13)
at /home/ampcome/projects/x1-platform/node_modules/async/dist/async.js:969:16
at /home/ampcome/projects/x1-platform/node_modules/graceful-fs/graceful-fs.js:45:10
at FSReqWrap.oncomplete (fs.js:141:20)
errors:
[ 'commons.js from UglifyJsnUnexpected token: punc ()) [commons.js:83270,22]' ],
warnings: }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
next.config.js file
const path = require('path');
const merge = require('lodash.merge');
const glob = require('glob')
const Uglify = require('uglifyjs-webpack-plugin');
module.exports = {
webpack: (config) => {
config.resolve = merge({}, config.resolve, {
alias: {
Components: path.resolve(__dirname, 'components'),
Libs: path.resolve(__dirname, 'libs'),
Sagas: path.resolve(__dirname, 'sagas'),
},
});
config.module.rules.push(
{
test: /.(css|scss)/,
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
}
,
{
test: /.css$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader']
}
,
{
test: /.css$/,
loaders: [
'style-loader',
'css-loader'
]
},
{
test: /.s(a|c)ss$/,
use: ['babel-loader', 'raw-loader', 'postcss-loader',
{ loader: 'sass-loader',
options: {
includePaths: ['scss', 'node_modules','styles']
.map((d) => path.join(__dirname, d))
.map((g) => glob.sync(g))
.reduce((a, c) => a.concat(c), )
}
}
]
}
)
config.node = {
fs: 'empty',
};
return config;
},
};
There are a lot of solutions given on the StackOverflow for this problem, but none of them are working for me.
I tried deactivating the Uglify plugin but that too is not working.
reactjs yarnpkg uglifyjs actionhero
reactjs yarnpkg uglifyjs actionhero
edited Nov 21 at 19:21
tk421
3,32231426
3,32231426
asked Nov 21 at 5:42
Vishal Shetty
340217
340217
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405873%2factionhero-build-failing-with-unexpected-token-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown