You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/24 09:49:53 UTC

[GitHub] [cordova-plugin-inappbrowser] yunusemreuveyik opened a new issue #805: Object(...) is not a function

yunusemreuveyik opened a new issue #805:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/805


   # Bug Report
   I was trying to install and use this plugin accordingly official doc
   
   ionic cordova plugin add cordova-plugin-inappbrowser
   npm install @ionic-native/in-app-browser
   
   
   ## Problem
   I just cant import this plugin as import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; in the official documentation because there is no folder under /in-app-browser as ngx and IDK why..
   
   and If ı just modify this import as import { InAppBrowser } from '@ionic-native/in-app-browser'; it just gives me error as Object(...) is not a function in the console
   
   
   ## Information
   my app.module.ts
   
   ```
   import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
   import { BrowserModule } from '@angular/platform-browser';
   import { RouteReuseStrategy } from '@angular/router';
   import { FormsModule, ReactiveFormsModule } from '@angular/forms';
   import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
   import { SplashScreen } from '@ionic-native/splash-screen/ngx';
   import { StatusBar } from '@ionic-native/status-bar/ngx';
   import { AppComponent } from './app.component';
   import { AppRoutingModule } from './app-routing.module';
   import { HttpClientModule } from '@angular/common/http';
   import { MatIconModule } from '@angular/material/icon';
   import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
   import { CommonModule } from '@angular/common';
   import { HTTP } from '@ionic-native/http/ngx';
   import { NativeStorage } from '@ionic-native/native-storage/ngx';
   import { IonicStorageModule } from '@ionic/storage';
   import { HttpService } from './services/http.service';
   import { Geolocation } from '@ionic-native/geolocation/ngx';
   import {MatInputModule} from '@angular/material/input';
   import {MatCardModule} from '@angular/material/card';
   import {MatSelectModule} from '@angular/material/select';
   import {MatDialogModule} from '@angular/material/dialog';
   import {  HttpClient } from '@angular/common/http';
   import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
   import { TranslateHttpLoader } from '@ngx-translate/http-loader';
   import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
   import { NgxMaskModule, IConfig } from 'ngx-mask'
   import { OneSignal } from '@ionic-native/onesignal/ngx';
   import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
   import { NgxQRCodeModule} from 'ngx-qrcode2';
   import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'  // gving me error Cannot find module '@ionic-native/in-app-browser/ngx' or its corresponding type declarations.ts(2307)
   
   const maskConfig: Partial<IConfig> = {
     validation: false,
   };
   export function HttpLoaderFactory(http: HttpClient) {
     return new TranslateHttpLoader(http, "./assets/i18n/", ".json");
   }
   
   @NgModule({
     declarations: [AppComponent],
     entryComponents: [],
     schemas:[CUSTOM_ELEMENTS_SCHEMA],
     imports: [
       NgxQRCodeModule,
       BrowserModule,
       IonicModule.forRoot(),
       AppRoutingModule,
       HttpClientModule,
       NgxMaskModule.forRoot(maskConfig),
       MatIconModule,
       IonicStorageModule.forRoot(),
       FormsModule,
       CommonModule,
       BrowserAnimationsModule,
       MatInputModule,
       MatCardModule,
       MatSelectModule,
       MatDialogModule,
       ReactiveFormsModule,
       TranslateModule.forRoot({
         loader: {
           provide: TranslateLoader,
           useFactory: (HttpLoaderFactory),
           deps: [HttpClient]
         }
       })
   
     ],
     providers: [
       StatusBar,
       SplashScreen,
       { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
       HTTP,
       Geolocation,
       NativeStorage,
       HttpService,
       MatDialogModule,
       PhotoViewer,
       OneSignal,
       InAppBrowser,
       BarcodeScanner
     
       
     ],
     bootstrap: [AppComponent]
   })
   export class AppModule { }
   
   ```
   
   
   
   ### Command or Code
   my package js file:
   
   ```
   {
     "name": "IonicSednaB2C",
     "version": "0.0.1",
     "author": "Ionic Framework",
     "homepage": "https://ionicframework.com/",
     "scripts": {
       "ng": "ng",
       "start": "ng serve",
       "build": "ng build",
       "build-prod": "ng build --prod",
       "test": "ng test",
       "lint": "ng lint",
       "e2e": "ng e2e"
     },
     "private": true,
     "dependencies": {
       "@angular/animations": "~9.1.6",
       "@angular/cdk": "^9.2.4",
       "@angular/common": "~9.1.6",
       "@angular/core": "~9.1.6",
       "@angular/forms": "~9.1.6",
       "@angular/material": "^9.2.4",
       "@angular/platform-browser": "~9.1.6",
       "@angular/platform-browser-dynamic": "~9.1.6",
       "@angular/router": "~9.1.6",
       "@capacitor/android": "^2.2.0",
       "@capacitor/core": "2.2.0",
       "@ionic-native/barcode-scanner": "^5.28.0",
       "@ionic-native/core": "^5.0.7",
       "@ionic-native/document-viewer": "^5.27.0",
       "@ionic-native/geolocation": "^5.27.0",
       "@ionic-native/http": "^5.26.0",
       "@ionic-native/in-app-browser": "^4.20.0",
       "@ionic-native/native-storage": "^5.26.0",
       "@ionic-native/onesignal": "^5.29.0",
       "@ionic-native/photo-viewer": "^5.27.0",
       "@ionic-native/splash-screen": "^5.26.0",
       "@ionic-native/status-bar": "^5.0.0",
       "@ionic/angular": "^5.2.3",
       "@ionic/app-scripts": "^3.2.4",
       "@ionic/storage": "^2.2.0",
       "@ngx-translate/core": "^13.0.0",
       "@ngx-translate/http-loader": "^6.0.0",
       "angular2-text-mask": "^9.0.0",
       "com-sarriaroman-photoviewer": "^1.2.5",
       "cordova-android": "8.1.0",
       "cordova-browser": "6.0.0",
       "cordova-plugin-advanced-http": "^2.5.1",
       "cordova-plugin-document-viewer": "^0.9.13",
       "cordova-plugin-file": "^6.0.2",
       "cordova-plugin-geolocation": "^4.0.2",
       "cordova-plugin-nativestorage": "^2.3.2",
       "cordova-plugin-splashscreen": "^5.0.2",
       "gulp": "^4.0.2",
       "gulp-babel": "^8.0.0",
       "gulp-concat": "^2.6.1",
       "gulp-rename": "^2.0.0",
       "gulp-terser": "^1.2.0",
       "gulp-uglify": "^3.0.2",
       "gulp-uglify-es": "^2.0.0",
       "ngx-mask": "^9.1.2",
       "ngx-qrcode2": "^9.0.0",
       "onesignal-cordova-plugin": "^2.11.0",
       "rxjs": "~6.5.1",
       "rxjs-compat": "^6.6.3",
       "safe-pipe": "^1.0.3",
       "tslib": "^1.10.0",
       "zone.js": "~0.10.2"
     },
     "devDependencies": {
       "@angular-devkit/build-angular": "~0.901.5",
       "@angular/cli": "~9.1.5",
       "@angular/compiler": "~9.1.6",
       "@angular/compiler-cli": "~9.1.6",
       "@angular/language-service": "~9.1.6",
       "@capacitor/cli": "2.2.0",
       "@ionic/angular-toolkit": "^2.1.1",
       "@ionic/cli-plugin-cordova": "1.6.2",
       "@ionic/cli-plugin-ionic-angular": "1.4.1",
       "@types/jasmine": "~3.5.0",
       "@types/jasminewd2": "~2.0.3",
       "@types/node": "^12.11.1",
       "babel-core": "^6.26.3",
       "codelyzer": "^5.1.2",
       "cordova-ios": "^6.1.1",
       "cordova-plugin-device": "^2.0.2",
       "cordova-plugin-inappbrowser": "^4.0.0",
       "cordova-plugin-ionic-keyboard": "^2.2.0",
       "cordova-plugin-ionic-webview": "^4.2.1",
       "cordova-plugin-statusbar": "^2.4.2",
       "cordova-plugin-whitelist": "^1.3.3",
       "jasmine-core": "~3.5.0",
       "jasmine-spec-reporter": "~4.2.1",
       "karma": "~5.0.0",
       "karma-chrome-launcher": "~3.1.0",
       "karma-coverage-istanbul-reporter": "~2.1.0",
       "karma-jasmine": "~3.0.1",
       "karma-jasmine-html-reporter": "^1.4.2",
       "phonegap-plugin-barcodescanner": "^8.1.0",
       "protractor": "~5.4.3",
       "ts-node": "~8.3.0",
       "tslint": "~6.1.0",
       "typescript": "~3.8.3"
     },
     "description": "An Ionic project",
     "cordova": {
       "plugins": {
         "cordova-plugin-splashscreen": {},
         "cordova-plugin-whitelist": {},
         "cordova-plugin-statusbar": {},
         "cordova-plugin-device": {},
         "cordova-plugin-ionic-webview": {
           "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
         },
         "cordova-plugin-ionic-keyboard": {},
         "cordova-plugin-advanced-http": {
           "OKHTTP_VERSION": "4.x.x"
         },
         "cordova-plugin-nativestorage": {},
         "cordova-plugin-geolocation": {},
         "com-sarriaroman-photoviewer": {},
         "onesignal-cordova-plugin": {},
         "cordova-plugin-document-viewer": {},
         "phonegap-plugin-barcodescanner": {
           "ANDROID_SUPPORT_V4_VERSION": "27.+"
         },
         "cordova-plugin-inappbrowser": {}
       },
       "platforms": [
         "android",
         "browser"
       ]
     }
   }
   ```
   
   
   
   
   ### Environment, Platform, Device
   my project just doesnt work trying to include this plugin with official doc way
   
   
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] I searched for existing GitHub issues
   - [x ] I updated all Cordova tooling to most recent version
   - [x ] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] timbru31 closed issue #805: Object(...) is not a function

Posted by GitBox <gi...@apache.org>.
timbru31 closed issue #805:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/805


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] timbru31 commented on issue #805: Object(...) is not a function

Posted by GitBox <gi...@apache.org>.
timbru31 commented on issue #805:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/805#issuecomment-715901728


   It seems you are using `@ionic/native` for the JS binding, please seeks support in their repo instead: https://github.com/ionic-team/ionic-native


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org