Ionic Pro: Issue when git push for building


#1

Hi
When I use git commit to push up my project to “ionic pro” and let it build
I got this kind of issue/problem in ionic pro.

L11: import { HomePage } from '../pages/home/home'; 
L12: import { MiddlewareService } from '../providers/middleware-service/middleware-service'; 
L13: import { UserdataProvider } from '../providers/userdata/userdata'; 

[18:43:45] typescript: src/app/app.module.ts, 
line: 13 Cannot find module '../providers/userdata/userdata'. 
...

[18:43:45] ionic-app-script task: "build" [18:43:45] Error: Failed to transpile program Error: Failed to transpile program at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28) at /usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:137:20 at Promise ()
    at transpileWorker (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:103:12)
    at Object.transpile (/usr/src/app/node_modules/@ionic/app-scripts/dist/transpile.js:61:12)
    at buildProject (/usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:97:78)
    at /usr/src/app/node_modules/@ionic/app-scripts/dist/build.js:47:16
    at 

npm info lifecycle ionic3-test-0001@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic3-test-0001@0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic3-test-0001@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitlab-runner/.npm/_logs/2017-10-13T13_39_08_230Z-debug.log

It only making this kind of an issue when building in ionic pro.
When building it here, on my local side and also creating an android app it works!.
The command “ionic serve” also works just fine.
So there’s no indication of any kind of bug or error.

I tried also to upgrade typescript if that would solve the case, but it didn’t change anything.

Here’s my setups:

  @ionic/cli-utils  : 1.12.0
   ionic (Ionic CLI) : 3.12.0

global packages:

   cordova (Cordova CLI) : 7.0.1 

local packages:

   @ionic/app-scripts : 2.1.4
   Cordova Platforms  : android 6.2.3 ios 4.4.0
   Ionic Framework    : ionic-angular 3.6.1

System:

   Android SDK Tools : 25.2.5
   ios-deploy        : 1.9.1 
   Node              : v6.7.0
   npm               : 3.10.8 
   OS                : macOS Sierra
   Xcode             : Xcode 8.3.3 Build version 8E3004b 

Misc:

   backend : pro

Typescript: 2.5.3 (did use 2.3.4 before)

Could it be some sort of an bug or issue somewhere in “ionic pro” ?


#2

Ionic Pro is a hosted and closed source service, so there is not much we, the community, can help you with, sorry. Check these:

You can - and should - contact support at http://ionicframework.com/support#support


#3

Thanks

I think I solve this issue anyway by myself.
It turns out that there is a name conflict of that you expect from the ionic pro system when building and when you build a package on your local system.

The solutions was more simple doing this:
In the package.json file I have now:

  "scripts": {
    "build": "ionic-app-scripts build",
   ....

But I change that to

  "scripts": {
    "build:local": "ionic-app-scripts build",
    "build": "true",

Or the name “build:local” could be customized as you like it. But it is important that you keep “build” as “true” according to the website : Failed-build-on-Ionic-1-app-Missing-build-script if you
wanna integrate your code and build system on your system with the ionic pro system.
Don’t ask me why , but it looks like there could be a name conflict here or some kind of a miss configuration that “ionic pro” system has. But not sure.

This now works on my system which was the above configuration I showed.

Note:
I now also not having any issue with the “module provider couldn’t be found” which was one issue that followed when using the ionic-app-scripts 2.5.3 or 3.0.0 to “build”.
But I think this is more a issue on ionic pro rather in the app script.


Ionic pro build fails module not found in app.module.ts but works fine in local
#4

If this works, I’m going to hunt you down and hug you to near death <3