Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object(...) is not a function #14

Open
sergiocarral1 opened this issue Dec 26, 2018 · 4 comments
Open

Object(...) is not a function #14

sergiocarral1 opened this issue Dec 26, 2018 · 4 comments

Comments

@sergiocarral1
Copy link

sergiocarral1 commented Dec 26, 2018

Hi,

Sorry if my question doesn't make sense I new with angular and ionic
I tried the Scan example and when I launch the ionic serve it returns this error:

PairPage.html:31 ERROR TypeError: Object(...) is not a function
at BLE.scan (index.js:28)
at PairPage.webpackJsonp.73.PairPage.scan (pair.ts:79)
at Object.eval [as handleEvent] (PairPage.html:31)
at handleEvent (core.js:13589)
at callWithDebugContext (core.js:15098)
at Object.debugHandleEvent [as handleEvent] (core.js:14685)
at dispatchEvent (core.js:10004)
at core.js:10629
at HTMLButtonElement. (platform-browser.js:2628)
at t.invokeTask (polyfills.js:3)

Are we taking device and error as function when they are objects?

The only thing that is different is the import:
import { BLE } from '@ionic-native/ble/ngx';

@blstechds
Copy link

@sergiocarral1 I am facing the exact issue. Did you get it resolved? Please help me. If you have used another library, please suggest.
Thanks in advance.

@V4NDER
Copy link

V4NDER commented Mar 15, 2019

I'm having the same problem, has anyone solved?

@monkeytronics
Copy link

monkeytronics commented Nov 27, 2019

Hi All. I was looking at the very same issue. I found that by rebiulding my project and specifiying cordova in the ionic start command:

$ ionic start myApp blank --cordova

the error went away. I'm working in Ionic 4, so some other elements of this utorial will not be the same though. For instance, you'll need to change the imports to :

import { BLE } from '@ionic-native/ble/ngx';

hope this helps you.

@Darkmagister
Copy link

Darkmagister commented Oct 22, 2020

i'm having the same issue, i tried the @monkeytronics solution but didn't work, also i'm using ionic 5,
here the error:

ERROR TypeError: Object(...) is not a function  
    at BLE.scan (vendor.js:81074) 
    at HomePage.webpackJsonp.248.HomePage.scan (main.js:74)  
    at Object.eval [as handleEvent] (HomePage.html:7)  
    at handleEvent (vendor.js:14225)
    at callWithDebugContext (vendor.js:15734)
    at Object.debugHandleEvent [as handleEvent] (vendor.js:15321)
    at dispatchEvent (vendor.js:10640)
    at vendor.js:11265
    at HTMLButtonElement.<anonymous> (vendor.js:40170)
    at t.invokeTask (polyfills.js:3)

also i have created a repo with the source, so you can check if there is something wrong
https://github.com/Darkmagister/testble/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants