[ng] ERROR in ./node_modules/@ionic-native/contacts/ngx/index.js
[ng] Module parse failed: Identifier 'checkAvailability' has already been declared (17:128)
[ng] You may need an appropriate loader to handle this file type.
[ng] | return c > 3 && r && Object.defineProperty(target, key, r), r;
[ng] | };
[ng] | import { IonicNativePlugin, checkAvailability, cordovaInstance, instanceAvailability, instancePropertyGet, instancePropertySet, checkAvailability, getPromise } from '@ionic-native/core';
[ng] | var Contact = /** @class */ (function () {
[ng] | function Contact() {
[ng] ℹ 「wdm」: Failed to compile.
Ionic Info
Ionic:
ionic (Ionic CLI) : 4.0.0-rc.13 (/usr/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.2
@angular-devkit/core : 0.7.2
@angular-devkit/schematics : 0.7.2
@angular/cli : 6.1.2
@ionic/ng-toolkit : 1.0.6
@ionic/schematics-angular : 1.0.4
Cordova:
cordova (Cordova CLI) : not installed
Cordova Platforms : none
System:
NodeJS : v10.8.0 (/usr/bin/node)
npm : 6.2.0
OS : Linux 4.15
Environment:
ANDROID_HOME : not set
Describe the Bug
I receive following error since update to "@ionic/angular": "4.0.0-beta.2" & "@ionic-native/contacts": "5.0.0-beta.14", "@ionic-native/core": "5.0.0-beta.14"
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
Just start Ionic App.
for me i have remove checkAvailability from node_modules/@ionic-native/contacts/ngx/index.js file line 17.
because it was write two time.
I can confirm Mayank5510's comment. After adjusting the index.js file (rename second, duplicated parameter), everything works as expected.
This is still an issue in the npm package beta-5.0.0-beta.17
This issue still persist in ionic-native/contacts-5.0.0-beta.21
same here in ionic-native/contacts-5.0.0-beta.21
Hi, I'm trying to find multiple contacts inside a foreach loop.
When I want to find the 2nd time, the contacts plugin fails with the error "create() failed, expecting Object, String given".
This is the line of the plugin that's failing:
The field "result[i]" has an "OK" string instead of a Contact.
I checked that the problem was related to "system availability", but I don't know how to fix it.
currently running "cordova-plugin-contacts": "^3.0.1" and "@ionic-native/contacts": "^4.15.0",

@ezequielbarnes I got same issue.
what is solution?

I can confirm Mayank5510's comment. After adjusting the index.js file (rename second, duplicated parameter), everything works as expected.
hello, should we update library directly yet?
Hi!, I've just waited a few seconds after trying again.
If you use the Promises correctly, you won't have any problem.
You have to set up a flag that blocks all attempts of using the Contacts
library until the last request has finished (async await it's a really good
way to achieve this)
Hope it helps!
On Tue, 27 Nov 2018 at 06:23, MobileWebPro notifications@github.com wrote:
@ezequielbarnes https://github.com/ezequielbarnes I got same issue.
what is solution?
[image: image]
https://user-images.githubusercontent.com/5020713/49071511-2d335380-f23f-11e8-805d-1928d57caecf.png—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic-native/issues/2642#issuecomment-441986439,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALzYGs6k9cAwvWXlXMjlII0Ptu9CLVvHks5uzQR_gaJpZM4V-Xxz
.
@ezequielbarnes I got same issue.
what is solution?
btw, your problem seems to be that you have the "checkAvailability" import twice. I don't think it's the same problem that I had.
This is still an issue in beta.22 - A revert to beta.15 fixes the problem.
Most helpful comment
same here in ionic-native/contacts-5.0.0-beta.21