UE4 4.20 unrealbuild error: One or more of the modules specified using the '-module' argument could not be found

unrealbuild function:
function unrealbuild{
UNR_PATH=PathToUnrealEngine;
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ));
CURR_DIR=pwd;
PROJ_NAME=$(basename ${1%.uproject});
${UNR_PATH}/Engine/Build/BatchFiles/Linux/Build.sh $PROJ_NAME -ModuleWithSuffix=$PROJ_NAME,$RANDNUM Linux Development -editorrecompile -canskiplink “${CURR_DIR}/${PROJ_NAME}.uproject” -progress
}

If I omit this line(‘ModuleWithSuffix=$PROJ_NAME,$RANDNUM’) from the uneralbuild function then it compile the c++ source file without having any error. However, it also disable the hot reload function.
*** The above build function works for 4.19 version with hot reload.
*** I found this line throw this build exception.
*** Also, I didn’t figure out the problem from my log file. link text

Where did you get that function?

Also does this module exist? -ModuleWithSuffix=TestBuild,1310 ? that is what it does not find, curious what the random number is doing there.

I get this function from here. And it is totally fine for 4.18 and previous version.
I have modified the function for 4.19 and it works. However it breaks down for 4.20.
Also, unreal wiki page has similar type of function. However, it doesn’t support hot reload.

I don’t know why we have to provide random number as suffix. However, I found generating random number as suffix in their source code.