We know `pathToRoot` could be undefined since it is an optional flag, but res.url for a view, that's just not right. We need to get to the bottom of this.