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.

TypeError: Nexmo is not a constructor

See original GitHub issue

Upgraded from 2.8.0 to 2.9.0 and now getting this error:

(node:45) UnhandledPromiseRejectionWarning: TypeError: Nexmo is not a constructor
    at Object.<anonymous> (/app/services/myService.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/app/routes.js:4:21)
const Nexmo = require('nexmo');

const nexmo = new Nexmo({
  apiKey: config.nexmo.apiKey, 
  apiSecret: config.nexmo.apiSecret
}, {
  debug: false,
  timeout: 60 * 1000
});

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kellyjandrewscommented, Aug 17, 2020

v2.9.1 should have the issue resolved - let me know if you see anything else.

0reactions
kellyjandrewscommented, Aug 17, 2020

We have a fix for this coming shortly https://github.com/Nexmo/nexmo-node/pull/318

Thanks @mheap!

Read more comments on GitHub >

github_iconTop Results From Across the Web

typings index.d.ts failing transpilation, needs an ts-ignore ...
Using @vonage/server-sdk with typescript doesn't transpile without an unrecommended bypass, but then it doesn't work at all.
Read more >
DocStrap Source: nexmoClientError.js
NexmoClientError = NexmoClientError; /** * Error constructor of an API-error * @param ... errorInput); } else { // if the structure is not...
Read more >
Vonage Server SDK for Node.js
Node.js Client for the Vonage API Platform. Latest version: 3.0.11, last published: 2 hours ago. Start using @vonage/server-sdk in your project by running ......
Read more >
Getting TypeError: User is not a constructor when testing ...
Try: User.create({username}) should not need to do a . · with newUser. · show me the result of console. · It's { username:...
Read more >
https://raw.githubusercontent.com/Nexmo/nexmo-node...
2.9.1 - FIXED: #317 - TypeError: Nexmo is not a constructor ## 2.9.0 - FIXED: #295 - Nexmo constructor changes of given options...
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