Comments (7)
The issue is that your number is not a string and in the format +2547xxxxxxx
@aksalj or @ianjuma :) need to fix the error message for when you have an invalid number format
from africastalking-node.js.
@denzelwamburu Ideally, it should not matter what framework you use. And any node version >= 0.12
should work fine.
Currently (v0.0.2
), AfricasTalking.SMS.send()
either thows an exception or always returns a promise; so this TypeError: Cannot read property 'then' of undefined
should not occur.
from africastalking-node.js.
@aksalj i updated the library to version 0.0.2
.
Works fine Now. :)
from africastalking-node.js.
This error (TypeError: Cannot read property then of undefined
) should not occur even with the non-string to
value because this is checking it and is supposed to throw an exception instead...
@pbombo yeah it should show a clear message instead of just throwing a generic error!
from africastalking-node.js.
@pbombo Even after using the format +2547xxxxxx
, the error still persists
from africastalking-node.js.
@denzelwamburu what version of the library and node
are you using?
Also when I replicate your code above like this
var AfricasTalking = require ('africastalking')({apiKey:null, username: null, format: "json"});
var sms = AfricasTalking.SMS;
var opts = {
to: 0704654445,
message: 'Server is Running'
};
console.log(opts);
sms.send(opts)
.then(function(s) {
console.log(s);
})
.catch(function(error) {
console.log(error);
});
here is what I (and should) get
TheWhiteRock:afticastalking aksalj$ node index.js
/Users/aksalj/src/playground/afticastalking/node_modules/africastalking/lib/index.js:43
throw error;
^
[object Object]
TheWhiteRock:afticastalking aksalj$
Like @pbombo said, opts.to
needs to be a string like "254704654445"
and not a number like 254704654445
.
from africastalking-node.js.
Hey @aksalj am on node v5.4.1
and library v0.0.1
Still using that string format throws the same error.
Apparently am using loopback, but when using express v4.13.1
throws the error you are getting.
Could it be the node version? Or the loopback library? or Both ? 😣
Saw an issue with node version here #12
from africastalking-node.js.
Related Issues (20)
- destructuring an undefined key HOT 1
- Security Venerability HOT 1
- Update Premium Urls. HOT 1
- v0.5.0 may have breaking changes ..sendsms error HOT 1
- High vulnerability with [email protected] HOT 2
- Cannot read property 'send' of undefined HOT 2
- send different messages to different numbers simultaneously ? HOT 2
- Vulnerability Report on Axios HOT 2
- The supplied authentication is invalid HOT 2
- Support for multiple numbers & clientRequestId in voice sdk
- Installing africastalking using npm not working HOT 10
- Error: Attempt to change mapping for "form" extension from "application/x-www-form-urlencoded" to "application/x-www-form-urlencoded". Pass `force=true` HOT 3
- Cannot read property 'send' of undefined HOT 1
- Support for Deno HOT 1
- Broken links on README.md file
- Typescript support HOT 5
- Voice API `callTo` Parameter Only Initiates Call to Last Number in Array HOT 6
- Request for Contribution Guide HOT 3
- Updating dependencies
- SMS Message With A Different String Font Being Sent in a Cryptic Manner HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from africastalking-node.js.