Closed jthoms1 closed 7 years ago
From @chrisbenseler on March 13, 2017 11:37
The problem is the flag --prod Without it the build/run is ok(but then the app takes too long to load).
Seems that the problem is the BrowserTestingModule. I added my spec files to the 'exclude' array in tsconfig.json "exclude": [ "node_modules", "*/spec*", "test", "src/test.ts" ]
ionic build android --prod is ok
@chrisbenseler Looks like the problem is coming from tests being included in compilation . But simply adding it to exclude is not working for me. It seems like ngc ignores it.
@rajeevriitm ngc does not ignore tsconfig.json. You have to be very vigilant, though. A single test-related file that is not excluded will break the build.
I don't have test files, but still see the same issue. ionic start
doesn't generate any test file, right?
@shawnlan please double-check that you really have the same issue. Specifically, make sure that your error messages reference "BrowserTestingModule" as OPs do.
@rapropos I have this line build prod failed: Error encountered resolving symbol values statically.
for sure. Before upgraded to Ionic 2.2.0 and app-scripts 1.1.4, building with --prod
is fine.
@shawnlan That is not necessarily the same issue. Please open a topic on the support forums. Your situation does not appear to be a framework bug, but rather a problem in your app.
@rapropos You were right. I did miss some some specs. Once that was included things are fine. This is how my tsconfig.josn looks.
"exclude": [
"node_modules","src/test.ts","src/**/*.spec.ts"
],
Thanks a lot man.
@rapropos I see. Changing an arrow function into an exported function in my app.module.ts solves my issue. Looks like ngc
is strict about some things. What are they? Where can I find the documentations?
@shawnlan,
Please review the angular documentation on ngc for any questions related to ngc. Things must be statically analyzable to be used by ngc
.
Thanks, Dan
From @jgw96 on March 13, 2017 11:26
From @chrisbenseler on March 13, 2017 10:51
Ionic version: (check one with "x") [ ] 1.x [X] 2.x
I'm submitting a ... (check one with "x") [X] bug report [ ] feature request [ ] support request
Current behavior: ionic build android outputs:
My package.json has
My ionic info Your system information:
Copied from original issue: driftyco/ionic#10754
Copied from original issue: driftyco/ionic-cli#1981