I have just gone upgraded my Ionic 2 app to Ionic 3, all of framework, Ionic native, and the CLI.
I now have the following setup..
"dependencies": {
"@angular/animations": "4.1.0",
"@angular/common": "4.1.0",
"@angular/compiler": "4.1.0",
"@angular/compiler-cli": "4.1.0",
"@angular/core": "^4.1.0",
"@angular/forms": "4.1.0",
"@angular/http": "^4.1.0",
"@angular/platform-browser": "4.1.0",
"@angular/platform-browser-dynamic": "4.1.0",
"@ionic-native/app-version": "^3.8.0",
"@ionic-native/core": "3.6.1",
"@ionic-native/device": "^3.8.0",
"@ionic-native/file": "^3.7.0",
"@ionic-native/network": "^3.8.0",
"@ionic-native/social-sharing": "^3.7.0",
"@ionic-native/splash-screen": "3.6.1",
"@ionic-native/status-bar": "3.6.1",
"@ionic-native/toast": "^3.8.0",
"@ionic/storage": "2.0.1",
"c3": "^0.4.11",
"ionic-angular": "3.2.1",
"ionicons": "3.0.0",
"js-logger": "^1.3.0",
"jslogger": "^1.0.3",
"jszip": "^3.1.3",
"lodash": "^4.17.4",
"moment": "^2.17.1",
"moment-duration-format": "^1.3.0",
"ng2-translate": "^5.0.0",
"rxjs": "5.1.1",
"semaphore-async-await": "^1.3.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.10"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-ionic-angular": "1.0.0",
"@types/c3": "^0.4.38",
"@types/jasmine": "^2.5.42",
"@types/jszip": "0.0.32",
"@types/lodash": "^4.14.51",
"@types/moment-duration-format": "^1.3.1",
"@types/node": "^7.0.5",
"codecov": "^1.0.1",
"install": "^0.8.7",
"jasmine-core": "^2.5.2",
"jasmine-spec-reporter": "^3.2.0",
"karma": "^1.4.1",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.1.0",
"karma-mocha-reporter": "^2.2.2",
"karma-remap-istanbul": "^0.6.0",
"ts-node": "^2.1.0",
"tslint": "^4.4.2",
"tslint-eslint-rules": "^3.3.0",
"typescript": "^2.2.1"
},
Now, if I build with the -prod flag (it id fine without this), I get the following error...
[16:50:08] webpack started ...
Error: ./~/jszip/lib/index.js
Module build failed: RangeError: Maximum call stack size exceeded
at Object.forEachChild (D:\dev\myapp\node_modules\typescript\lib\typescript.js:14735:26)
at traverse (D:\dev\myapp\node_modules\typescript\lib\typescript.js:7271:31)
at Object.forEachReturnStatement (D:\dev\myapp\node_modules\typescript\lib\typescript.js:7251:16)
at checkAndAggregateReturnExpressionTypes (D:\dev\myapp\node_modules\typescript\lib\typescript.js:40055:16)
at getReturnTypeFromBody (D:\dev\myapp\node_modules\typescript\lib\typescript.js:39965:29)
at getReturnTypeOfSignature (D:\dev\myapp\node_modules\typescript\lib\typescript.js:31190:28)
at resolveNewExpression (D:\dev\myapp\node_modules\typescript\lib\typescript.js:39483:21)
at resolveSignature (D:\dev\myapp\node_modules\typescript\lib\typescript.js:39639:28)
at getResolvedSignature (D:\dev\myapp\node_modules\typescript\lib\typescript.js:39669:26)
at checkCallExpression (D:\dev\myapp\node_modules\typescript\lib\typescript.js:39696:29)
@ ./src/providers/file-logger.ts 58:0-28
@ ./src/app/app.module.ngfactory.ts
@ ./src/app/main.ts,./~/d3/d3.js
Module build failed: RangeError: Maximum call stack size exceeded
at RegExp.[Symbol.replace] (native)
at String.replace (native)
at formatStringFromArgs (D:\dev\myapp\node_modules\typescript\lib\typescript.js:2365:21)
at Object.chainDiagnosticMessages (D:\dev\myapp\node_modules\typescript\lib\typescript.js:2433:20)
at reportNonexistentProperty (D:\dev\myapp\node_modules\typescript\lib\typescript.js:38290:28)
at checkPropertyAccessExpressionOrQualifiedName (D:\dev\myapp\node_modules\typescript\lib\typescript.js:38332:
21)
at checkPropertyAccessExpression (D:\dev\myapp\node_modules\typescript\lib\typescript.js:38274:20)
at checkExpressionWorker (D:\dev\myapp\node_modules\typescript\lib\typescript.js:41158:28)
at checkExpression (D:\dev\myapp\node_modules\typescript\lib\typescript.js:41115:42)
at checkExpressionWithContextualType (D:\dev\myapp\node_modules\typescript\lib\typescript.js:40983:26)
@ ./src/pages/mypage/mypage.ts 61:0-25
@ ./src/app/app.module.ts
@ ./src/app/app.module.ngfactory.ts
@ ./src/app/main.ts
I have tracked this down to the 2 libs C3/D3, and jszip. If I use either of these in a small newly created Ionic 3 app, then there is not a problem.
I have gone through many many other reports of webpack throwing this error, but just cannot see why this is now happening for me, in my existing project.
This occurs for either the new Ionic CLI version 3, or for an older version (2.2.3) when I downgraded to it.
[UPDATE1]
Running on a second machine (Windows 10) with node v6.9.4 (the above was node 7.something), and npm 4.2.0, I get similar but differently formatted error...
[16:31:04] webpack started ...
[16:31:35] webpack finished in 31.23 s
[16:31:35] sass started ...
[16:31:36] transpile bundle started ...
[16:31:44] build prod failed: Maximum call stack size exceeded
[16:31:44] ionic-app-script task: "build"
[16:31:44] RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at checkNonNullExpression (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:38258:40)
at resolveNewExpression (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:39433:34)
at resolveSignature (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:39639:28)
at getResolvedSignature (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:39669:26)
at checkCallExpression (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:39696:29)
at checkExpressionWorker (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:41163:28)
at checkExpression (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:41115:42)
at checkExpressionCached (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:40996:38)
at H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:40058:32
at traverse (H:\dev\myapp\upgradeto3\node_modules\typescript\lib\typescript.js:7255:28)
[UPDATE2]
As another test, I added a new empty page, and added nothing but the C3 import, and then a call to a single function (generate) from the library.
This new page gets the same error.
Does anyone have any idea of how to track this down / fix this problem? I am out of ideas, and I just can't restart the project from blank again.
Thanks in advance for any help
[UPDATE3]
I thought I'd try to update TypeScript to the latest 2.3.2. When I rerun npm install, I do get some warnings..
+-- UNMET PEER DEPENDENCY @angular/[email protected]
+-- UNMET PEER DEPENDENCY @angular/[email protected]
`-- [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (curre
nt: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/http@^2.0.0 but none was installed.
I don't quite understand the two UNMET PEER DEPENDENCY as I do have exactly @angular/[email protected] and @angular/[email protected] installed.
At any rate, I still get the same overflow. Really not sure what to try next. Once again, these libraries both build fine in a newly created Ionic application, maybe because it is a lot smaller?
Also I did find this issue, but it looks a little different to mine here...
For me the solution has been to have the latest Ionic, including the latest CLI, except holding TypeScript at 2.3.0 as suggested by imgx64 here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With