rect + nextjs + uglify:意外令牌:name(n)+大小限制插件

时间:2018-11-13 09:12:42

标签: reactjs docker webpack uglifyjs next.js

我有ReactJS + NextJS项目,在“下一步构建”时进行了缩小和丑化处理。 构建时会引发以下错误日志:

> Failed to build
{ Error: (client) bundles/pages/test.js from UglifyJs
Unexpected token: name (n) [bundles/pages/test.js:1,587012]
    at /usr/src/app/node_modules/next/dist/server/build/index.js:162:31
    at runWithDependencies (/usr/src/app/node_modules/webpack/lib/MultiCompiler.js:154:4)
    at /usr/src/app/node_modules/async/dist/async.js:1140:9
    at /usr/src/app/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/usr/src/app/node_modules/async/dist/async.js:1064:13)
    at /usr/src/app/node_modules/async/dist/async.js:969:16
    at /usr/src/app/node_modules/async/dist/async.js:1137:13
    at runCompilers (/usr/src/app/node_modules/webpack/lib/MultiCompiler.js:96:47)
    at fn (/usr/src/app/node_modules/webpack/lib/MultiCompiler.js:101:6)
    at compiler.run (/usr/src/app/node_modules/webpack/lib/MultiCompiler.js:150:5)
    at emitRecords.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:265:13)
    at Compiler.emitRecords (/usr/src/app/node_modules/webpack/lib/Compiler.js:371:38)
    at emitAssets.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/usr/src/app/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/usr/src/app/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
  errors:
   [ '(client) bundles/pages/test.js from UglifyJs\nUnexpected token: name (n) [bundles/pages/test.js:1,587012]',
     '(client) bundles/pages/team.js from UglifyJs\nUnexpected token: name (r) [bundles/pages/team.js:1,489566]' ],
  warnings: [] }

但是奇怪的是,这里的构建在Local&Local Docker中运行良好。 但是在任何其他环境中都失败。

有关更多信息:我们使用高山图像构建docker。

0 个答案:

没有答案