Not able to use getCities method
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);
});
},
};
Sorry about that @rodmirsantana, I will publish a new version with this method right now! Just sec...
I published version 1.0.0-rc.8. I think that now you just need to update our package in your project. Again, sorry about that, I forgot to publish the latest feature merged :(
Can you check and tell us if it works?
@hyanmandian I tried both yarn add @brazilian-utils/brazilian-utils and npm install @brazilian-utils/brazilian-utils, but still got version 1.0.0-rc.7. Can you double-check please?
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).
I've tried here and managed to update now! Thank you.