Since the question of how to add a Bootstrap 4, Sage-friendly navwalker comes up a lot in this forum, I made a Sage composer dependency to solve the problem. Now, all you need to do is include this composer package in your Sage theme and the navwalker will be available to use.
Check it out:
From the README:
Sets up a Bootstrap 4 Navwalker for Sage 9-based themes.
To install, run the following in your Sage9-based theme directory:
composer require "mwdelaney/sage-bootstrap4-navwalker"
Include the navwalker in your
wp_nav_menu( array( 'menu' => 'primary', 'theme_location' => 'primary', ... 'walker' => new wp_bootstrap4_navwalker()) );