ionic-framework: bug: ion-input broken with --prod
Type: <span ionic-type>bug</span>
Ionic Version: <span ionic-version>3.9.2</span>
Platform: <span ionic-platform>all</span>
<span ionic-description>After building with --prod an <ion-input> inside an <ion-item> will no longer bind using ngModel or update styling in response to input events.
Using: node v8.9.3 npm v5.5.1 Ionic CLI v3.19.0 Ionic-Angular v3.9.2
Tested on both mac and windows
Step 1) Install Ionic: npm install -g cordova ionic
Step 2) Create blank app: ionic start myApp blank
Step 3)
add the following code to <ion-content> of home.html:
<ion-item>
<ion-input [(ngModel)]="foo"></ion-input>
</ion-item>
<p>{{foo}}</p>
Step 4) test it in development mode (works fine): ionic serve
Step 5) test it in production mode: ionic cordova run browser --prod
The ngModel binding of {{foo}} will no longer work. Also the color underline styling of the <ion-input> will no longer work. The underline will not turn blue when focused.</span>
<span is-issue-template></span>
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 27 (3 by maintainers)
Commits related to this issue
- Fixed https://github.com/ionic-team/ionic/issues/13718 — committed to anatoly-spb/ionic-app-scripts by anatoly-spb 7 years ago
Confirmed. I think it is broken because of ionic/app-scripts uses new version uglify-es (“3.3.2” instead of “3.2.2”). Here is difference between working and non-working build from my CI server: https://pastebin.com/mjJeWeNi
As the result ionic is very dangerous to use in production because without changing anything from your side (code, config.xml, package.json) you can get broken production build as it was in my case. In my case the broken version has been deployed to production channel and supplied to my customers.
@jdubois @d3viant0ne it does not help because ionic/app-scripts uses direct dependence and unpined version:
in our case the possible workaround is pinning version in our projects package.json files as @Jetro223 remarked:
@hussembadri actually it is not needed anymore since hot fix in
@ionic/app-scripts@3.1.7Thanks! Please install the next release of app-scripts.
Again, thanks @anatoly-spb and @filipesilva