Cannot seem to get hook_preprocess_page to work in 8.4.2
both should work on custom MODULE or THEME

function MODULENAME_preprocess_page(&amp;$vars) {
  //do stuff
}

function MODULENAME_preprocess(&amp;$vars, $hook) {
  if($hook == 'page') {
    //do stuff
  }
}


You need to rebuild cache and at least when using netbeans be careful not all lines will trigger the breakpoint ... for example I have noticed that multiline array definitions will not trigger it.  Post your code for more details