[SOLVED] Ionic Pro: build error

hi,
today i try ionic pro, and i can’t build correctly,
if ionic-angular = 3.6.1, we need use rxjs 5.4.0 and typescript 2.4.0, i have same error on local if
i modify packages,
thanks you

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
  on IonicJS Snapshot Runner (6c67ff43)
Using Shell executor...
Running on ip-10-2-85-230...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/6c67ff43/0/project-1'...
Checking out f382ef2b as master...
Skipping Git submodules setup
$ fetch-updates
Checking for build process updates...
$ build-app
Fetching build dependencies...
Running: npm install
npm WARN deprecated babili@0.1.2: babili has been renamed to babel-minify. Please update to babel-minify
npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to babel-preset-minify
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

> node-sass@4.5.3 install /usr/src/app/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-57_binding.node
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/gitlab-runner/.npm/node-sass/4.5.3/linux-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /usr/src/app/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.5.3 postinstall /usr/src/app/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
added 1031 packages in 36.435s
npm WARN ionic-angular@3.6.1 requires a peer of rxjs@5.4.0 but none was installed.
npm WARN ionic-angular@3.6.1 requires a peer of zone.js@0.8.12 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm install succeeded
Running: npm run build
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle projetposglobal@0.0.13~prebuild: projetposglobal@0.0.13
npm info lifecycle projetposglobal@0.0.13~build: projetposglobal@0.0.13

> projetposglobal@0.0.13 build /usr/src/app
> ionic-app-scripts build

[06:07:07]  ionic-app-scripts 2.1.4 
[06:07:07]  build dev started ... 
[06:07:07]  clean started ... 
[06:07:07]  clean finished in 1 ms 
[06:07:07]  copy started ... 
[06:07:07]  transpile started ... 
[06:07:14]  typescript: node_modules/ionic-native/node_modules/rxjs/Subject.d.ts, line: 16 
            Class 'Subject' incorrectly extends base class 'Observable'. Types of property 'lift' are 
            incompatible. Type '(operator: Operator) => Observable' is not assignable to type '(operator: 
            Operator) => Observable'. Type 'Observable' is not assignable to type 'Observable'. Type 'T' 
            is not assignable to type 'R'. 

      L16:  export declare class Subject extends Observable implements ISubscription {
      L17:      observers: Observer[];

[06:07:14]  typescript: node_modules/ionic-native/node_modules/rxjs/observable/dom/WebSocketSubject.d.ts, line: 23 
            Class 'WebSocketSubject' incorrectly extends base class 'AnonymousSubject'. Types of property 'lift' 
            are incompatible. Type '(operator: Operator) => WebSocketSubject' is not assignable to type 
            '(operator: Operator) => Observable'. Type 'WebSocketSubject' is not assignable to type 
            'Observable'. Types of property 'operator' are incompatible. Type 'Operator' is not assignable to 
            type 'Operator'. Type 'R' is not assignable to type 'T'. 

      L23:  export declare class WebSocketSubject extends AnonymousSubject {
      L24:      url: string;

[06:07:14]  ionic-app-script task: "build" 
[06:07:14]  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 projetposglobal@0.0.13~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projetposglobal@0.0.13 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the projetposglobal@0.0.13 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-09-16T06_07_14_850Z-debug.log
Detected www/ directory commited to version control. Assuming Ionic 1 app.
Uploading build...
Build upload successful.
Running after script...
$ clean-up
Cleaning up files...
Successful clean up

Ionic Pro is a hosted and closed source service, so there is not much we, the community, can help you with. There is a FAQ and common/known issues at https://ionic.zendesk.com/hc/en-us/sections/115003254647-FAQ-Common-Issues You can - and should - contact support at http://ionicframework.com/support#support1. There is also https://ionicframework.com/docs/pro/.

Do you get the same errors when you build locally with ionic build for example?

What is your ionic info output?

no, working in local, with typescript 2.3.4 and 2.4.0

cli packages: (/home/celtiore/Documents/projetpos/node_modules)

@ionic/cli-utils  : 1.10.2
ionic (Ionic CLI) : 3.10.3

global packages:

Cordova CLI : 7.0.1 

local packages:

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

System:

Android SDK Tools : 25.2.5
Node              : v8.5.0
npm               : 5.4.1 
OS                : Linux 4.10

solved :
i have fixed typescript 2.3.4, removed node_modules, platforms, plugins and fresh re install

thanks you

Hi, what does “i have fixed typescript 2.3.4” mean???

2 Likes

I had to change: (uppercase J!)

import { Observable } from 'rxJs';

into

import { Observable } from 'rxjs';