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

TypeError: Object(...) is not a function #31

Closed
MattL-NZ opened this issue Sep 24, 2018 · 4 comments
Closed

TypeError: Object(...) is not a function #31

MattL-NZ opened this issue Sep 24, 2018 · 4 comments
Labels

Comments

@MattL-NZ
Copy link

MattL-NZ commented Sep 24, 2018

I'm getting an TypeError: Object(...) is not a function error when trying to use Native Geocoder.

Code is below:

import { NativeGeocoder, NativeGeocoderOptions, NativeGeocoderReverseResult, NativeGeocoderForwardResult } from '@ionic-native/native-geocoder'; constructor(private Platform: Platform, public loadingCtrl: LoadingController, private router: Router, public natGeo: NativeGeocoder) {}
... let options: NativeGeocoderOptions = { useLocale: true, maxResults: 5 };

this.natGeo.forwardGeocode('Berlin', options) .then((coordinates: NativeGeocoderForwardResult[]) => console.log('The coordinates are latitude=' + coordinates[0].latitude + ' and longitude=' + coordinates[0].longitude)) .catch((error: any) => console.log(error)); ...

How can I get this to work please?

@sebastianbaar
Copy link
Owner

Hey @MattL-NZ,

please re-post your code as a code block. Otherwise it's too hard to read. And please specify the line where the error occurs. Thanks.

Cheers

@marquish
Copy link

I got the same issue, as i recently updated to ionic 4.4.0
Any suggestions ?

Uncaught TypeError: Object(...) is not a function
    at vendor.js:70033
    at Module../node_modules/@ionic-native/native-geocoder/index.js (vendor.js:70089)
    at __webpack_require__ (runtime.js:84)
    at Module../src/app/app.module.ts (main.js:1753)
    at __webpack_require__ (runtime.js:84)
    at Module../src/main.ts (main.js:2127)
    at __webpack_require__ (runtime.js:84)
    at Object.0 (main.js:2149)
    at __webpack_require__ (runtime.js:84)
    at checkDeferredModules (runtime.js:46)

@sebastianbaar
Copy link
Owner

Hey @marquish,
please fill out the bug template and point out where the error shows up in your code:

Thanks!


Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior or sample code/repo.

Expected behavior
A clear and concise description of what you expected to happen.

Plugin Version
vX.X.X

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] or Emulator: [e.g. Nexus 7]
  • OS: [e.g. iOS8.1]

Additional context
Add any other context about the problem here.

@sebastianbaar
Copy link
Owner

Closed due to inactivity

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

No branches or pull requests

3 participants