0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Next.js typeScript型エラー

Posted at

ここのhandlerに下記のようなエラーが出てきました。
型エラーだと思いますが、解決できなくて困っています。

型 '(req: any, res: any, name: any, password: any) => Promise<void>' を型 'NextApiHandler<any>' に割り当てることはできません。ts(2322)
const handler: NextApiHandler = async (req, res,  name, password) => {
  const salt = crypto.randomBytes(16).toString('hex')
  const hash = crypto
  .pbkdf2Sync(password, salt, 1000, 64, 'sha512')
  .toString('hex')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?