-
Notifications
You must be signed in to change notification settings - Fork 44
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
Export Default? #55
Comments
Hey @tstachl, can you please check now, I've added example how to use it with TypeScript and fixed the typings. Please let me know if still doesn't work for you. |
Hey @aodinok, it works with import("messagebird").then((messagebird: any) => {
const client = messagebird("API_KEY");
return new Promise((resolve, reject) => {
client.balance.read((err, data) => {
if (err) reject(err);
resolve(data);
});
});
}); |
same issue |
Using esModuleInterop is not an ideal solution |
Hello, any update on this? // eslint-disable-next-line @typescript-eslint/no-var-requires
this.messageBirdClient = require("messagebird")("MESSAGEBIRD_KEY"); But it is not the best one |
…ault fix: #55 Do not use default export
messagebird-nodejs/types/index.d.ts
Line 366 in 633bb8c
Can you guys fix your Typescript types to not use
export default
, it doesn't work and I'm getting the following type error:TypeError: messagebird_1.default is not a function
Here is also some additional reading on why
export default
is bad:The text was updated successfully, but these errors were encountered: