Closed sansan88 closed 6 years ago
@sansan88 Hi! That issue is related with the new rxjs version. The solution is search this kind of imports
import { Observable } from "rxjs";
and change it to:
import { Observable } from "rxjs/Observable";
Hope it helps :grinning:
@niconaso No, didn't help. I changed all imports allready.
Can you post your package.json? It seems you did not run any issue with ngc. I am having some issue. Did you install angular cli locally?
What version of Ionic native core do you have?
I fixed mine. It took me 5 hours to refactor rxjs. Here are the things I had to do:
for all my http services I had to import import { catchError, map } from 'rxjs/operators';
and refactor
.map((response: Response) => response.json())
.catch(response => this.handleError(response))
to
.pipe(
map((response: Response) => response.json()),
catchError(response => this.handleError(response))
)
Then Observable.throw
I had to turn into
import { ErrorObservable } from 'rxjs/observable/errorObservable';
...
return ErrorObservable.create(error);
And because I used finally
in my code I had to convert it to finalize
import { finalize } from 'rxjs/operators';
...
this.myService.index()
.pipe(
finalize(()=>{
...
})
)
.subscribe(
...
)
Other things that you might want to pay attention to is that some operators have changed:
do -> tap
catch -> catchError
switch -> switchAll
finally -> finalize
I hope you find it helpful and that you don't have to refactor whole code...
@mlynch
"@ionic-native/core": "4.4.0",
Same error here while running npm run ionic:build --prod
:
Error: ./node_modules/rxjs/observable/BoundNodeCallbackObservable.js Module build failed: TypeError: Cannot read property 'type' of undefined at Object.getEffectiveTypeAnnotationNode
Upgrading typescript to "typescript": "~2.6.1"
solve the problem. All seems to work fine with typescript 2.6 but ....is typescript 2.6 supported? :grimacing:
I also was able to build the pwa with typescript 2.6.1. But the build took 15 minutes..
"author": "Sandro Scalco",
"version": "1.12.1",
"description": "unihockey.club | Vereinsmanagement",
"homepage": "http://unihockey.club/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@ionic-native/calendar": "4.3.3",
"@ionic-native/camera": "4.3.3",
"@ionic-native/contacts": "4.3.3",
"@ionic-native/core": "4.3.3",
"@ionic-native/email-composer": "4.3.3",
"@ionic-native/facebook": "4.3.3",
"@ionic-native/file": "4.3.3",
"@ionic-native/in-app-browser": "4.3.3",
"@ionic-native/onesignal": "4.3.3",
"@ionic-native/paypal": "4.3.3",
"@ionic-native/splash-screen": "4.3.3",
"@ionic-native/status-bar": "4.3.3",
"@ionic-native/youtube-video-player": "4.3.3",
"@ionic/cloud-angular": "0.12.0",
"@ionic/pro": "1.0.14",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^0.1.0",
"@types/papaparse": "^4.1.30",
"angular2-elastic": "^0.13.0",
"com.paypal.cordova.mobilesdk": "~3.5.0",
"cordova-browser": "~5.0.1",
"cordova-plugin-add-swift-support": "^1.6.1",
"cordova-plugin-camera": "~2.4.1",
"cordova-plugin-compat": "~1.1.0",
"cordova-plugin-device": "1.1.4",
"cordova-plugin-email": "~1.2.6",
"cordova-plugin-facebook4": "~1.7.4",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-inappbrowser": "~1.6.1",
"cordova-plugin-ionic": "^2.0.1",
"cordova-plugin-ionic-webview": "^1.1.11",
"cordova-plugin-splashscreen": "~4.0.1",
"cordova-plugin-statusbar": "^2.2.3",
"cordova-plugin-whitelist": "1.3.1",
"cordova-plugin-youtube-video-player": "^1.0.6",
"firebase": "^4.6.2",
"ionic-angular": "^3.9.2",
"ionic-plugin-keyboard": "~2.2.1",
"ionicons": "~3.0.0",
"json2csv": "^3.7.3",
"ng-elastic": "^1.0.0-beta.3",
"onesignal-cordova-plugin": "2.1.0",
"papaparse": "^4.3.6",
"reflect-metadata": "^0.1.10",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18",
"cordova-ios": "~4.5.3"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.0",
"ionic": "3.18.0",
"typescript": "2.6.1"
},
"cordova": {
"platforms": [
"browser",
"ios",
"android"
],
"plugins": {
"com.paypal.cordova.mobilesdk": {},
"cordova-plugin-camera": {
"CAMERA_USAGE_DESCRIPTION": "App would like to access the camera",
"PHOTOLIBRARY_USAGE_DESCRIPTION": "App would like to access the library."
},
"cordova-plugin-compat": {},
"cordova-plugin-device": {},
"cordova-plugin-email": {},
"cordova-plugin-facebook4": {
"APP_ID": "XXXXX",
"APP_NAME": "unihockey.club"
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"cordova-sqlite-storage": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-youtube-video-player": {},
"cordova-plugin-file": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic": {
"APP_ID": "XXXX",
"CHANNEL_NAME": "Production",
"UPDATE_METHOD": "background",
"UPDATE_API": "https://api.ionicjs.com",
"MAX_STORE": "2"
},
"onesignal-cordova-plugin": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-add-swift-support": {}
}
}
}```
@ashley-s no.. did not install angular cli
Description: running command npm run ionic:build --prod throws error
Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js Module build failed: TypeError: Cannot read property 'type' of undefined at Object.getEffectiveTypeAnnotationNode
Steps to Reproduce: run command npm run ionic:build --prod
Output:
[19:51:27] ionic-app-scripts 3.1.0 [19:51:27] build prod started ... [19:51:27] clean started ... [19:51:27] clean finished in 71 ms [19:51:27] copy started ... [19:51:28] deeplinks started ... [19:51:29] deeplinks finished in 1.05 s [19:51:29] ngc started ... [19:51:53] ngc finished in 24.03 s [19:51:53] preprocess started ... [19:51:53] preprocess finished in 1 ms [19:51:53] webpack started ... [19:51:54] copy finished in 26.42 s [19:55:52] ionic-app-script task: "build" [19:55:52] Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js Module build failed: TypeError: Cannot read property 'type' of undefined at Object.getEffectiveTypeAnnotationNode (C:\Users\sandr\CloudStation\Development\app\node_modules\typescript\lib\typescript.js:9341:17)
My
ionic info
: ionic/cli-utils : 1.18.0 ionic (Ionic CLI) : 3.18.0global packages: cordova (Cordova CLI) : 7.1.0
local packages: ionic/app-scripts : 3.1.0 Cordova Platforms : android 6.2.3 browser 5.0.1 ios 4.4.0 windows Ionic Framework : ionic-angular 3.9.2
System: Node : v6.11.3 npm : 3.10.10 OS : Windows 10
Environment Variables: ANDROID_HOME : not set
Misc: backend : pro
Other Information: