Skip to content
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

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. When createTempUser is called #88

Open
mmccor26 opened this issue Nov 16, 2019 · 8 comments

Comments

@mmccor26
Copy link

No description provided.

@mmccor26 mmccor26 changed the title TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. When createTempUser is called Nov 16, 2019
@mmccor26
Copy link
Author

This error occurs when you call the function
events.js:174
throw er; // Unhandled 'error' event
^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at Object.randomBytes (internal/crypto/random.js:48:11)
at Object.options.source (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/rand-token/index.js:60:25)
at Object.generate (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/rand-token/index.js:95:29)
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/email-verification/index.js:286:58
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/model.js:4604:16
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:4351:12
at model.Query.Query._completeOne (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:2054:12)
at Immediate.Query.base.findOne.call (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:2116:10)
at Immediate. (/home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mquery/lib/utils.js:116:16)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
Emitted 'error' event at:
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/model.js:4606:13
at /home/ubuntu/environment/se3316-mmccor26-lab5/node_modules/mongoose/lib/query.js:4351:12
[... lines matching original stack trace ...]
at processImmediate (timers.js:658:5)
Waiting for the debugger to disconnect...

@Isaac-Leanos
Copy link

This exact error is destroying me lol

@KKKaneki
Copy link

Is there a answer for this? I am getting the same error

@Flo2410
Copy link

Flo2410 commented Mar 19, 2020

I'm getting it to...

@datnguyen293
Copy link

This package is too old. It's not compatible with new node (v9 up). It is using old version of rand-token package when this issue was not fixed. Please take a look here for more information: sehrope/node-rand-token#10

@datnguyen293
Copy link

It is very simple fix I made by the fork here: https://github.com/datnguyen293/node-email-verification

I also created a pull request to original repository: #89

@MatviiStelmakh
Copy link

MatviiStelmakh commented Dec 6, 2020

as a temporary solution you can:

  1. add "rand-token": "^0.4.0" to your package.json
  2. use npm shrinkwrap
  3. change in npm-shrinkwrap.json
"email-verification": {
      "version": "0.4.6",
      "resolved": "https://registry.npmjs.org/email-verification/-/email-verification-0.4.6.tgz",
      "integrity": "sha1-DFRXJ/1onS12hWZvUbaLRMc5QkA=",
      "requires": {
        "mongoose": "~3.8.0",
        "nodemailer": "^1.3.0",
        "rand-token": "^0.4.0"
      },

@andrei-deeyu
Copy link

Aahh guys! After 3 hours I finally found it! rand-token doesn't work.

Opening the Issues tab to read this page oh wait.. - nevermind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants