You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ionic version: (check one with "x")
[ ] 2.x
[x] 3.x
[ ] 4.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
Current behavior:
When compiling an application that uses ionic-angular, and strictNullChecks is enabled in tsconfig.json, AOT compilation of the Alert component template fails with the following error:
Error at /Users/peter/myapp/node_modules/ionic-angular/components/alert/alert-component.d.ts.AlertCmp.html(1,417): Object is possibly 'undefined'.
Error at /Users/peter/myapp/node_modules/ionic-angular/components/alert/alert-component.d.ts.AlertCmp.html(1,1760): Object is possibly 'undefined'.
Expected behavior:
The app should compile with no errors.
Note: I understand that building Ionic itself is not yet supported with strictNullChecks enabled, but this bug is the only one that I'm aware of which prevents applications themselves from being built using Ionic and strictNullChecks.
Steps to reproduce:
ionic start myapp blank
cd myapp
Edit tsconfig.json and add "strictNullChecks": true, inside compilerOptions
node_modules/.bin/ngc
Other information:
The compile errors come from two places in the template within src/components/alert/alert-component.ts where possibly-undefined properties of the component are accessed: d.inputs and d.buttons.
I have prepared a patch (which we have been using in our app for several months) and will submit a pull request.
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
local packages:
@ionic/app-scripts : 3.1.8
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 5.5.1
OS : macOS High Sierra
Misc:
backend : legacy
The text was updated successfully, but these errors were encountered:
Modify the Alert component's template to add extra checks to d.inputs
and d.buttons to avoid compile errors when using ahead-of-time
compilation when strictNullChecks is enabled in tsconfig.json.
Fixes: ionic-team#14056
Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
Ionic version: (check one with "x")
[ ] 2.x
[x] 3.x
[ ] 4.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
Current behavior:
When compiling an application that uses
ionic-angular
, andstrictNullChecks
is enabled intsconfig.json
, AOT compilation of the Alert component template fails with the following error:Expected behavior:
The app should compile with no errors.
Note: I understand that building Ionic itself is not yet supported with strictNullChecks enabled, but this bug is the only one that I'm aware of which prevents applications themselves from being built using Ionic and strictNullChecks.
Steps to reproduce:
ionic start myapp blank
cd myapp
tsconfig.json
and add"strictNullChecks": true,
insidecompilerOptions
node_modules/.bin/ngc
Other information:
The compile errors come from two places in the template within
src/components/alert/alert-component.ts
where possibly-undefined properties of the component are accessed:d.inputs
andd.buttons
.I have prepared a patch (which we have been using in our app for several months) and will submit a pull request.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: