At version 4.24, the old workflow of creating a Directions widget without a RouteLayer was deprecated, and will be a breaking change at version 4.27, due to arrive in June 2023.
https://developers.arcgis.com/javascript/latest/4.24/#routing
See the Directions widget sample for how it looks to create a Directions widget with a RouteLayer.
https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-directions
Directions widget code snippet with RouteLayer:

Also at version 4.24, we deprecated several properties on the Directions widget and DirectionsViewModel. We typically remove deprecated things after 3 or more releases. At version 4.27, we are removing the following deprecated properties.
This is a breaking change. The replacement to use is listed alongside the deprecated property.