{"action":"closed","issue":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/15199","repository_url":"https://api.github.com/repos/ionic-team/ionic","labels_url":"https://api.github.com/repos/ionic-team/ionic/issues/15199/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic/issues/15199/comments","events_url":"https://api.github.com/repos/ionic-team/ionic/issues/15199/events","html_url":"https://github.com/ionic-team/ionic/issues/15199","id":351103817,"node_id":"MDU6SXNzdWUzNTExMDM4MTc=","number":15199,"title":"[ionic4] HTTP ionic native JS error (@ionic-native/http)","user":{"login":"bibounet","id":12274624,"node_id":"MDQ6VXNlcjEyMjc0NjI0","avatar_url":"https://avatars1.githubusercontent.com/u/12274624?v=4","gravatar_id":"","url":"https://api.github.com/users/bibounet","html_url":"https://github.com/bibounet","followers_url":"https://api.github.com/users/bibounet/followers","following_url":"https://api.github.com/users/bibounet/following{/other_user}","gists_url":"https://api.github.com/users/bibounet/gists{/gist_id}","starred_url":"https://api.github.com/users/bibounet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bibounet/subscriptions","organizations_url":"https://api.github.com/users/bibounet/orgs","repos_url":"https://api.github.com/users/bibounet/repos","events_url":"https://api.github.com/users/bibounet/events{/privacy}","received_events_url":"https://api.github.com/users/bibounet/received_events","type":"User","site_admin":false},"labels":[{"id":835668554,"node_id":"MDU6TGFiZWw4MzU2Njg1NTQ=","url":"https://api.github.com/repos/ionic-team/ionic/labels/triage","name":"triage","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-16T08:23:19Z","updated_at":"2018-08-17T09:09:55Z","closed_at":"2018-08-17T09:09:55Z","author_association":"NONE","body":"# Bug Report\r\n\r\n**Ionic Info**\r\n```\r\nIonic:\r\n\r\n   ionic (Ionic CLI)          : 4.0.6 (C:\\Users\\toto\\AppData\\Roaming\\npm\\node_modules\\ionic)\r\n   Ionic Framework            : @ionic/angular 4.0.0-beta.2\r\n   @angular-devkit/core       : 0.7.3\r\n   @angular-devkit/schematics : 0.7.3\r\n   @angular/cli               : 6.1.3\r\n   @ionic/ng-toolkit          : 1.0.6\r\n   @ionic/schematics-angular  : 1.0.4\r\n\r\nCordova:\r\n\r\n   cordova (Cordova CLI) : 8.0.0\r\n   Cordova Platforms     : android 7.0.0\r\n\r\nSystem:\r\n\r\n   NodeJS : v8.9.4 (C:\\Program Files\\nodejs\\node.exe)\r\n   npm    : 5.6.0\r\n   OS     : Windows 10\r\n```\r\n\r\n**Describe the Bug**\r\nOne adding *HTTP ionic native* to an *ionic4* project it crash at android app lauch,\r\nHTTP ionic native module throw an JS error : \r\n```\r\nindex.js:518 Uncaught TypeError: Object(...) is not a function\r\n    at index.js:518\r\n    at Object../node_modules/@ionic-native/http/index.js (index.js:702)\r\n    at __webpack_require__ (bootstrap:81)\r\n    at Object../src/app/app.module.ts (app.component.ts:11)\r\n    at __webpack_require__ (bootstrap:81)\r\n    at Object../src/main.ts (environment.ts:15)\r\n    at __webpack_require__ (bootstrap:81)\r\n    at Object.0 (main.ts:12)\r\n    at __webpack_require__ (bootstrap:81)\r\n    at checkDeferredModules (bootstrap:43)\r\n```\r\n\r\n```\r\nl513:    };\r\nl514:    HTTP.decorators = [\r\nl515:        { type: Injectable },\r\nl516:    ];\r\nl517:    __decorate([\r\nl518:        Cordova({ sync: true }), // <----------------------------------\r\nl519:        __metadata(\"design:type\", Function),\r\nl520:        __metadata(\"design:paramtypes\", [String, String]),\r\nl521:        __metadata(\"design:returntype\", Object)\r\nl522:    ], HTTP.prototype, \"getBasicAuthHeader\", null);\r\n```\r\n\r\n**Steps to Reproduce**\r\n1. start ionic4 project\r\n2. ionic cordova platform add android\r\n3. ionic cordova plugin add cordova-plugin-advanced-http\r\n4. npm install --save @ionic-native/http\r\n5. Add HTTP plugin to your app's module\r\n6. ```\r\n    constructor(private http: HTTP) {}\r\n\r\n    public getHtmlTest(url: string): void {\r\n            this.http.get(url, {}, {})\r\n                .then(data => {\r\n                    console.log(data.status);\r\n                    console.log(data.data); // data received by server\r\n                    console.log(data.headers);\r\n                })\r\n                .catch(error => {\r\n                    console.log(error.status);\r\n                    console.log(error.error); // error message as string\r\n                    console.log(error.headers);\r\n                });\r\n    }\r\n```"}}
{"actor":{"display_login":"bibounet"}}