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.

Not able to use getCities method

See original GitHub issue

Hey guys, I’m trying to use the getCities method but I’m getting: Uncaught TypeError: (0 , _brazilianUtils.getCities) is not a function error on the console. I installed the lib using yarn and I’m importing it in my js file as below. What could be the issue?

import { getCities } from '@brazilian-utils/brazilian-utils';
...

const Methods = {
async init() {
    await Methods.getCitiesList();
 }

getSelectedOption(sel) {
     var opt;
     for (var i = 0, len = sel.options.length; i < len; i++) {
       opt = sel.options[i];
       if (opt.selected === true) {
         break;
       }
     }
     return opt;
   },

async getCitiesList() {
     Elements.selectState.addEventListener('change', (el) => {
       const selectedState = Methods.getSelectedOption(Elements.selectState).value;
       const citiesList = getCities(selectedState);
       console.log(citiesList);
     });
   },

};

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rodmirsantanacommented, Jun 18, 2020

I’ve tried here and managed to update now! Thank you.

0reactions
hyanmandiancommented, Jun 18, 2020

Please, try again. I updated the latest tag on NPM right now. You can check here: https://www.npmjs.com/package/@brazilian-utils/brazilian-utils (just click on version).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with Spring 3 + JSON : HTTP status 406?
But I get HTTP 406 error stating the following when i run it: 406 Not Acceptable The requested resource is only capable of...
Read more >
Issues · harpreetkhalsagtbit/country-state-city - GitHub
I am unable to get cities for UK. I am using City.getCitiesOfState(countryCode, stateCode) method to get a city. #99 opened on Jul 11...
Read more >
Calling function from Controller in cshtml file. - Microsoft Q&A
Hello What i would like to do is call my GetCity method in my controller class once the user has submitted an input...
Read more >
Why locationManager is not called … | Apple Developer Forums
The issue is that the first time I call the getZipCode() or the getCity() methods I get an empty string. Here is how...
Read more >
Why Local Variables are Bad for Tuning Stored Procedures
GetCities AS RETURN 0') GO ALTER PROCEDURE dbo. ... (Note: I'm not saying you should use temporary stored procedures in your production code...
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