Cannot read properties of undefined (reading 'replace') Whatsapp Node Error

Hey everyone, I’m running into an error with the WhatsApp Business Cloud node that says: Cannot read properties of undefined (reading 'replace'). I’m trying to send a message using data from an incoming WhatsApp trigger, and I’ve set the recipient’s phone number using {{$('Incoming Message Trigger').item.json.contacts[0].wa_id}}. I have tried the metadata one, but I’m not sure why this error keeps popping up. Has anyone seen this before or know what might be causing it? Would really appreciate any help!

Hi @faaiz_ul_haq

This error means that the property used in replace doesn’t exist (undefined basically).

Ensure that the property exists.

Could you share the workflow?

Sorry for the really late reply!

Could you share yoir workflow in json version please?

I’m not able to share the json version as it is saying that png, jpeg and etc are allowed

Insert your workflow by clicking ‘</>’ and pasting in the workflow’s code.

Click on the gear to do that.

Here’s the workflow so yeah I am really confused why this error is coming

Plus the main problem is that it works as a test workflow but when I activate it and than test it it doesn’t