How can I correct HMAC validation error in my code?

const hmac_header = req.get(‘X-Shopify-Hmac-Sha256’);

const map = Object.assign({}, req.query);
delete map[‘hmac’];
const message = querystring.stringify(map);

const genHash = crypto
.createHmac(‘sha256’, process.env.SHOPIFY_API_SECRET)
.update(JSON.stringify(message))
.digest(‘hex’);

if(genHash === hmac_header){
Valid
} else {
Invalid request
}

but i am getting invalid request error

I followed below youtube video

https://www.youtube.com/watch?v=D3iO4mZHgLk&t=2368s

in above video, they are comparing as
if(genHash === hmac**)**

but it should compare with hmac in the header send by Shopify, please correct me if i am wrong

i tried above as well, and got below error

Received an error response (400 Bad Request) from Shopify:
If you report this error, please include this id:

Please help!

Thanks in advance :slightly_smiling_face: