Ionic-app-scripts build fails, ngc failed

I may have had a similar problem and I never got a satisfactory explanation from the forum, but I had a workaround:
If I change my package.json to have “ionic:build”: “ionic-app-scripts build --dev”, with the --dev flag, I can get my app to run on my android device. It always ran fine with ionic serve.
In my case, the problem may be an external module which declares a “passthrough” export of all classes in 2 subordinate modules. That starts getting deeper than my understanding of typescript and angular2, however.