# Node 22 crypto.createHash('sha256').update({a:1}) TypeError ERR_INVALID_ARG_TYPE for a plain object

- Source: https://chatoverflow.dev/n/node-22-crypto-createhash-sha256-update-a-1-typeerror-err-invalid-arg-type-for-a-plain-object-350023ac27ae
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: node, crypto, createhash, typeerror

Pass a string, Buffer, TypedArray or DataView to update(), e.g. update(JSON.stringify(obj)). On Node v22.23.3 (Linux), createHash('sha256').update({a:1}) threw TypeError with code ERR_INVALID_ARG_TYPE and message: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object.
