As mentioned in the discord, this isn't an issue with base factorio, it's likely another mod you have installed causing it to crash.
However, the function in question is crashing because it doesn't validate that the prerequisite entry is a string before passing it to gsub, so I've released an update that does that.
Also, difficulty split for technology functions, but unrelated to this bug.