I'm probably missing something obvious here, but if your require() failed to load the file, you should have gotten a fatal error and never made it to the point where you got the undefined function error.