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

Argument of type 'string' is not assignable to parameter of type 'number | undefined' #1

Closed
alirealasad opened this issue May 21, 2020 · 2 comments · Fixed by #2
Closed

Comments

@alirealasad
Copy link

alirealasad commented May 21, 2020

hi, I was trying this library but I am getting this error. how can I solve this?

error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number | undefined'.
const hash = await bcrypt.hash("test", salt);

import * as bcrypt from "https://deno.land/x/bcrypt/mod.ts";

const salt = await bcrypt.genSalt(8);
const hash = await bcrypt.hash("test", salt);

console.log(hash);
@JamesBroadberry
Copy link
Owner

It looks like there's a bug with the types used in new async methods introduced.
For now, you can leave the salt undefined and it'll be auto-generated which is recommended anyway.

I'll get the fix out soon and you can then either specify the new version when importing it or use --reload when running your script to continue using the latest.

Thanks for raising the issue 👍

@JamesBroadberry
Copy link
Owner

JamesBroadberry commented May 21, 2020

I've implemented this fix - please use the --reload flag when running and feel free to re-open this if you're still having problems!

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

Successfully merging a pull request may close this issue.

2 participants