生产构建失败,使用plotly.js和ionic 3

时间:2018-04-03 12:42:34

标签: android typescript ionic-framework ionic3 plotly.js

我在Ionic(3.6.1)中使用了plotly.js(@ 1.35.2)和types / plotly.js。

使用ionic serve时,所有内容(包括图表)在浏览器中都能正常运行。使用ionic cordova run android --device时,它也可以正常工作。该应用程序安装在设备上并可以使用。但是启动应用程序时需要等待很长时间。

当我尝试使用ionic cordova run android --device构建应用程序以进行生产时,我会收到错误并且构建根本无法正常工作。我认为它与生产构建中使用的缩小过程有关。我不确定我是否也能正确理解错误。

这是我得到的错误:

Error: ./node_modules/d3/d3.js
Module build failed: RangeError: Maximum call stack size exceeded
at checkPropertyAccessExpressionOrQualifiedName (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:38454:62)
at checkPropertyAccessExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:38413:20)
at checkExpressionWorker (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41300:28)
at checkExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41257:42)
at checkBinaryLikeExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40834:28)
at checkBinaryExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40827:20)
at checkExpressionWorker (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41335:28)
at checkExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41257:42)
at checkBinaryLikeExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40834:28)
at checkBinaryExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40827:20)
 @ ./node_modules/plotly.js/src/plots/plots.js 9:9-22
 @ ./node_modules/plotly.js/src/transforms/groupby.js
 @ ./node_modules/plotly.js/lib/groupby.js
 @ ./node_modules/plotly.js/lib/index.js
 @ ./src/pages/statSites/statQuestionnaire/statQuestionnaire.ts
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts,./node_modules/plotly.js/src/plots/cartesian/axes.js
Module parse failed: Error parsing regular expression: Invalid regular expression: / newDiff + 1e-6) % 1 < 2e-6 &&(((newFirst - ax._forceTick0) /: Unmatched ')' (185:53)
You may need an appropriate loader to handle this file type.
|         // and forceTick0 can be shifted to newFirst
|         if (function (ax, _minDtick) {
|             if (_minDtick === void 0) { _minDtick = / newDiff + 1e-6) % 1 < 2e-6 &&(((newFirst - ax._forceTick0) / newDiff % 1) +
|                 1.000001) % 1 < 2e-6; }
|             ax._minDtick = newDiff;
 @ ./node_modules/plotly.js/src/transforms/filter.js 11:11-45
 @ ./node_modules/plotly.js/lib/filter.js
 @ ./node_modules/plotly.js/lib/index.js
 @ ./src/pages/statSites/statQuestionnaire/statQuestionnaire.ts
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (/home/aiko/IdeaProjects/etmos_the/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at callback (/home/aiko/IdeaProjects/etmos_the/node_modules/@ionic/app-scripts/dist/webpack.js:119:28)
at emitRecords.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:265:13)
at Compiler.emitRecords (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:371:38)
at emitAssets.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:258:10)
at applyPluginsAsyncSeries1.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:364:12)
at next (/home/aiko/IdeaProjects/etmos_the/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/aiko/IdeaProjects/etmos_the/node_modules/tapable/lib/Tapable.js:222:13)

0 个答案:

没有答案