TypeError: Bexio is not a constructor
valmiremini opened this issue · comments
Hi,
I get the error "TypeError: Bexio is not a constructor" by Following your example.
// import the module
import Bexio from "bexio";
//assign token string
var API_TOKEN = 'my token';
// init the module with the API_TOKEN
const bexio = new Bexio(API_TOKEN);
// show the contact with ID 1 (Promise)
bexio.contacts.show(1).then((contact) => {
console.log(contact);
});
Neat package by the way.
Hi @valmiremini
Sorry I must have missed the notification...
can you debug the code and check what is in Bexio
?
Same here, it returns
{ BillsStatic: [Getter], BusinessActivitiesStatic: [Getter], CalendarStatic: [Getter], ContactGroupsStatic: [Getter], ContactRelationsStatic: [Getter], ContactSectorsStatic: [Getter], ContactTypesStatic: [Getter], ContactsStatic: [Getter], ExpensesStatic: [Getter], NotesStatic: [Getter], OrdersStatic: [Getter], ProjectsStatic: [Getter], ProjectStatusesStatic: [Getter], ProjectTypesStatic: [Getter], SalesOrderManagementStatic: [Getter], TimetrackingsStatic: [Getter], TimetrackingStatusesStatic: [Getter], UsersStatic: [Getter], ItemsStatic: [Getter], default: [class Bexio] }
@ItsCoding please send me the import statement and how you try to call the constructor?
It looks like you imported it wrong. or just use .default
and call the constructor there
Housekeeping