Fix rebuild

can `mock` be an undefined?