Actionhero构建失败,出现意外的令牌错误

时间:2018-11-21 05:42:10

标签: reactjs yarnpkg uglifyjs actionhero

我正在使用ReactHero作为服务器的React JS项目。 在localhost上,一切正常,但是当我尝试在本地构建项目时,出现此错误消息。

fun main(args: Array<String>) {
var flag = true
Thread {
    Thread.sleep(2000)
    println("time over")
    flag = false
}.start()
while (flag) {
   //Do nothing
}
println("finish")
}

next.config.js文件

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 UglifyJs\nUnexpected 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.

StackOverflow上针对此问题提供了许多解决方案,但没有一个对我有用。

我尝试停用Uglify插件,但这也无法正常工作。

0 个答案:

没有答案