Im upgrading a D7 module to D8 and it turns out conf_path() is deprecated but I cant find the replacement.
I found a github page that said use this
but I still WSOD when that is called.
Note: In D8, instead of using conf_path(), \Drupal\Core\DrupalKernel::getSitePath() instead. If the kernel is unavailable (such as above, where the code shows the booting of the D8 kernel) or the site path needs to be recalculated then Drupal\Core\DrupalKernel::findSitePath() can be used
So if you have access to the DrupalKernel object, then calling getSitePath() on that object will work. This is probably not the case.
However, there is a service for this called site.path that can be injected into a class that you need it. I think the change record could be updated to reference this factory class.
Using the global Drupal object:
$conf_path = \Drupal::service('site.path');