[Solved] err: TypeError: Cannot call method ‘replace’ of undefined [duplicate]


You have this error message because req.query.message is undefined. Check that the variable req.query.message exists and this should work.

2

solved err: TypeError: Cannot call method ‘replace’ of undefined [duplicate]