Always check your versions!
Did you know that String.Prototype.replaceAll()
was added in Node v15? Because as of this morning I do!
After weeks of daily emails only sending periodically, I finally zeroed in on the issue - I was on Node version 16 and the server was on 14 for developing this script. It was a tricky issue to diagnose since the emails were sending sometimes - but last night my error logging finally caught the issue in the act and I was able to trace that the issue was with a String.replaceAll()
- hmm that's odd, I've surely used replaceAll()
in my scripts before 🤔
As it turns out, this was the first time I had set up a script to use replaceAll()
on this server. When you run into a weird dev machine vs server error, don't forget to check your versions (and maybe even check them periodically just to be safe).
Note to self: Check versions!