question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ionic 4: Blank screen in simulator when using http-native

See original GitHub issue

Ionic version: (check one with “x”) (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [ ] 3.x [x] 4.x

I’m submitting a … (check one with “x”) [x] bug report [ ] feature request

Current behavior: I’m getting a blank screen when I try to use the http-native.

Expected behavior: The App should launch properly

Steps to reproduce:

  1. Create a new ionic 4 project, ex: tabs
  2. Follow the steps to add cordova-plugin-advanced-http described here: https://ionicframework.com/docs/native/http/
  3. Launch the app in the simulator: ionic cordova emulate ios -lc
  4. Result: blank screen

Error in Safari console: TypeError: Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"]) is not a function. (In 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])({ sync: true })', 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])' is an instance of Object)

Related code:

`` import { Component } from ‘@angular/core’; import { Platform } from ‘@ionic/angular’; import { HTTP } from ‘@ionic-native/http’;

@Component({ selector: ‘app-page-about’, templateUrl: ‘about.page.html’, styleUrls: [‘about.page.scss’] }) export class AboutPage {

constructor( private http: HTTP, private platform: Platform, ) {

console.log('### 1 Vai chamar...');
this.platform.ready().then(() => {
  console.log('### 2 chamou!');
  this.http.get('http://ionic.io', {}, {})
  .then(data => {
    console.log('### 3 resultado:');
    console.log(data.status);
    console.log(data.data); // data received by server
    console.log(data.headers);
  })
  .catch(error => {
    console.log('### 4 babou!');
    console.log(error.status);
    console.log(error.error); // error message as string
    console.log(error.headers);
  });
});

}

}

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

li packages: (/usr/local/lib/node_modules)

   @ionic/cli-utils  : 2.0.0-rc.6
   ionic (Ionic CLI) : 4.0.0-rc.6

global packages:

   cordova (Cordova CLI) : 8.0.0

local packages:

   @angular-devkit/core       : 0.6.0
   @angular-devkit/schematics : 0.6.0
   @angular/cli               : 6.0.1
   @ionic/schematics-angular  : 1.0.0-rc.6
   Cordova Platforms          : ios 4.5.4
   Ionic Framework            : @ionic/angular 4.0.0-alpha.7

System:

   Android SDK Tools : 25.2.5
   ios-deploy        : 1.9.2
   ios-sim           : 6.1.2
   NodeJS            : v8.11.2
   npm               : 5.6.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.3.1 Build version 9E501

Environment Variables:

   ANDROID_HOME : /usr/local/opt/android-sdk

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
aaronksaunderscommented, Sep 11, 2018

try using the ngx on all of the imports and make sure you are using beta versions

import { Camera } from '@ionic-native/camera/ngx';
    "@ionic-native/camera": "^5.0.0-beta.15",
    "@ionic-native/core": "^5.0.0-beta.17",
1reaction
bandodebitscommented, Aug 31, 2018

Did you post the gist? I’m having the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ionic 4: Blank screen in simulator when using http-native #14520
I'm getting a blank screen when I try to use the http-native. ... Steps to reproduce: Create a new ionic 4 project, ex:...
Read more >
Ionic 4 Ios build getting blank screen - Stack Overflow
I find at a solution for this problem, follow the next step: 1) close Xcode;. 2) Make sure localhost is allowed in config.xml:...
Read more >
Blank screen on ios - ionic-v3
Hello,. I got a blank screen when starting app on ios or from simulator, any idea? Here the ouptut from xcode console
Read more >
Debugging the Ionic White Screen of Death - YouTube
In this video, we walk through 4 different steps you can take to help track down errors that are occurring in your Ionic...
Read more >
Ionic capacitor app shows only white blank screen in ios
I have an app developed in Ionic it is working fine in Web and Android it is even in Google ... just show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found