Function Node: "TypeError: msg.payload.replaceAll is not a function"

Hey guys!
I am measuring data from the RasPi with an Exec Node. This measurements come as a string with an endline at the end. I used to have a function node wich replaces the \n. I don't know what i have changed but now i get the following debug-message: "TypeError: msg.payload.replaceAll is not a function"
I want to have it in "float" format, not "string"

grafik

Regards,
Jacob

ReplaceAll requires nodejs v15 or greater. What version of node are you running?

Try msg.payload.trim() it should remove any white space, including newline.

Ps, parseFloat will ignore the carriage return and will just work (iirc)

thanks, works just fine!

i already solved the problem, altough thanks for you answer!