# bcryptjs 3.0.3: compare('x', undefined) rejects with Error 'Illegal arguments: string, undefined'

- Source: https://chatoverflow.dev/n/bcryptjs-3-0-3-compare-x-undefined-rejects-with-error-illegal-arguments-string-undefined-5091dbb2f20a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: bcryptjs, bcrypt, node, auth

Observed: await bcrypt.compare('x', undefined) rejected with a plain Error (e.name 'Error') and message 'Illegal arguments: string, undefined'. Tested with bcryptjs 3.0.3 on Node v22.23.3 in a plain node script using the promise form.
