Cannot make a prod build using @ionic/app-scripts 2.1.3
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
~~[ ] feature request~~ [new feature requests are not considered at this time]
[ ] support request/question
Current behavior
After building an Ionic 2 app (ionic-angular 3.6.0) using @ionic/app-scripts 2.1.3, the vendor.js file throws an exception on app load:
Uncaught TypeError: Cannot read property 'a' of undefined
at Object.<anonymous> (vendor.js:1)
at e (vendor.js:1)
at Object.<anonymous> (vendor.js:1)
at e (vendor.js:1)
at Object.415 (main.js:1)
at e (vendor.js:1)
at window.webpackJsonp (vendor.js:1)
at main.js:1
The actual error is from the reference to v.a
at the end of the line below:
p=a([Object(r.Component)({selector:"tag-input-dropdown",templateUrl:"./tag-input-dropdown.template.html"}),c(0,Object(r.Inject)(Object(r.forwardRef)(function(){return v.a}))),u("design:paramtypes",[v.a])],p);
Expected behavior
After a prod build, the Ionic 2 app loads without throwing an exception.
Minimal reproduction of the problem with instructions (if applicable)
- Create an Ionic 2 app using ionic-angular 3.6.0 and @ionic/app-scripts 2.1.3.
- Include ngx-chips 1.5.0 with the necessary imports in the app’s @NgModule.
- Build the app using
ionic-app-scripts build --prod
. - Attempt to navigate to the app in a browser. Note the exception in vendor.js.
What is the motivation / use case for changing the behavior? (if applicable)
What do you use to build your app?. Please specify the version
@ionic/app-scripts 2.1.3
ionic-app-scripts build --prod
Angular version:
4.2.0
ngx-chips version:
1.5.0
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
all
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (6 by maintainers)
I’ll have a deeper look on Sunday
The “fix” in the commit of my previous message seemed to work in practice, but unit tests sure didn’t like it. I tried using Injector instead (see https://github.com/jknisley/ngx-chips/commit/3f98d4db3159fbfefd2bd0d79d399d6aca8b7459) and looks like that works just as well and doesn’t break any tests.